<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7702816563349321195</atom:id><lastBuildDate>Sat, 18 Feb 2012 06:41:17 +0000</lastBuildDate><category>flash</category><category>ruby on rails</category><category>ubuntu</category><category>css</category><category>javascript</category><category>vista</category><category>html</category><title>Supriya's Blog</title><description /><link>http://supriya-surve.blogspot.com/</link><managingEditor>noreply@blogger.com (Supriya Surve)</managingEditor><generator>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SupriyasBlog" /><feedburner:info uri="supriyasblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-6666092681382077938</guid><pubDate>Sat, 10 Sep 2011 09:03:00 +0000</pubDate><atom:updated>2011-09-10T02:03:59.349-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><title>A Cross Browser* and Standards Compliant Custom ScrollBar Script by Hesido</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I have tried to style the scrollbars through CSS. I used&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;scrollbar-base-color: #009966;
scrollbar-track-color: #009966;
scrollbar-face-color: #ffff99;
scrollbar-highlight-color: #009966;
scrollbar-3dlight-color: #009966;
scrollbar-darkshadow-color: #009966;
scrollbar-shadow-color: #009966;
scrollbar-arrow-color: #009966;&lt;/pre&gt;
&lt;br /&gt;
But browsers like Firefox and Safari was not able to get the this styling.&lt;br /&gt;
I tried to find solution for this, but was not successful until I got this site : &lt;a href="http://www.hesido.com/web.php?page=customscrollbar" target="blank"&gt;hesido.com&lt;/a&gt;.&lt;br /&gt;
This site helps for styling scrollbar using javascript with examples and source code.&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-6666092681382077938?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/pP4GUK1T3UM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/pP4GUK1T3UM/cross-browser-and-standards-compliant.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/11/cross-browser-and-standards-compliant.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-3302892501881396287</guid><pubDate>Sat, 10 Sep 2011 08:46:00 +0000</pubDate><atom:updated>2012-02-02T22:17:48.948-08:00</atom:updated><title>Sequencing data in rails application</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
There are many plugins available for sequencing data. Sharing something similar which depends on the jQuery library.&lt;br /&gt;
Considering that there is a Single table inheritance with more that 15 different types.&lt;br /&gt;
There were more than 15 views of the inherited modules.&lt;br /&gt;
Now applying a view with required buttons in these many views may be posible but what if new types are introduced in future, styling may change, many things were there for pointing down.&lt;br /&gt;
Finally decided to do these all with jquery. Also consider that there 1 sequence column in the table.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Controller :&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:html"&gt;# reset_sequence action is called using the JavaScript Ajax function.
# The JS function passes client id, model type(constant) and the array of
# record id and the index to update in the constant
def reset_sequence
  model_type = params[:model_type]
  paramssequences = params[:sequences]
  clientid = params[:client_id].to_i
  paramssequences.each do |sequences|
    sequences.each do |sequence_array|
      sequence_record = sequence_array.split(",")
      id = sequence_record[0].to_i
      sequence = sequence_record[1].to_i
      object = model_type.singularize.camelize.constantize
      object.update_all({:sequence =&amp;gt; sequence}, {:id =&amp;gt; id, :client_id =&amp;gt; clientid})
    end
  end
  respond_to do |format|
  format.js {
    render :update do |page|
      # need this block with out this it gives 302 error if sucess block added for ajax in javascript
      # else gives missing template error :: TODO
    end
  }
  end
end &lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Routes :&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:html"&gt;reset_sequence&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;View : &lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:html"&gt;  &amp;lt;table id="first_sub_types"&amp;gt;
  &amp;lt;tbody&amp;gt;
  &amp;lt;tr&amp;gt;
  &amp;nbsp;&amp;nbsp;&amp;lt;th&amp;gt;Sequence&amp;lt;/th&amp;gt;
  &amp;nbsp;&amp;nbsp;&amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;
  &amp;nbsp;&amp;nbsp;&amp;lt;th&amp;gt;Edit&amp;lt;/th&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;% first_sub_types.each do |subtype| %&amp;gt;
  &amp;lt;tr&amp;gt;
  &amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;&amp;lt;%= subtype.sequence %&amp;gt;&amp;lt;/td&amp;gt;
  &amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;&amp;lt;%= subtype.name %&amp;gt;&amp;lt;/td&amp;gt;
  &amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;&amp;lt;%= link_to "Edit", edit_first_sub_type_path(subtype.id) %&amp;gt;&amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;% end %&amp;gt;
  &amp;lt;/tbody&amp;gt;
  &amp;lt;/table&amp;gt;
  

  &amp;lt;script type="text/javascript"&amp;gt;  
&amp;nbsp;&amp;nbsp;&amp;nbsp; fetch_data("FirstSubType", 3, "first_sub_types")
  &amp;lt;/script&amp;gt;  &lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Javascript :&lt;/b&gt;&lt;br /&gt;
Added 1 new .js file in public/javascript, we can say sequencing.js&lt;br /&gt;
Sequnce.js :&lt;br /&gt;
Very first function declared was fetch_data( modelType, clientID, divID )&lt;br /&gt;
this function will be called from the bottom of the view in which sequencing is required.&lt;br /&gt;
Just sending the modeltype for e.g ("FirstSubType", 3, "first_sub_types")&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:html"&gt;/*
* fetch_data function will get the id name of the table and convert it in to jquery object.
* This will also call build_html function by passing object created, model type(which model to be called), company id and divid separately.
*/

function fetch_data( modelType, clientID, divID ){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var obj = jQuery(divID);
&amp;nbsp;&amp;nbsp;&amp;nbsp; build_html( obj, modelType, clientID, divID );
  }&lt;/pre&gt;
&lt;br /&gt;
we can see above we have defined a variable with the divid which we passed from the view.&lt;br /&gt;
also called other function build_html.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:html"&gt;/*
* This function is only called through the fetch_data().
* build_html will first check the object's tag name by jquery function .is() and based on this checkIfobject will be assigned a value.
* This assigned value will be used for sorting &amp;lt;td&amp;gt; OR &amp;lt;li&amp;gt; OR &amp;lt;option&amp;gt;.
* After checking the html tag the objects width is changed to fit the buttons on the right side.
* At the end loopingList() is called
*/

function build_html( obj, modelType, clientID, divID ){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var checkIfobject;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; if(obj.is("table")){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; checkIfobject = "TaBle"
&amp;nbsp;&amp;nbsp;&amp;nbsp; }else if(obj.is("ul")){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; checkIfobject = "UL"
&amp;nbsp;&amp;nbsp;&amp;nbsp; }else if(obj.is("select")){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; checkIfobject = "SelEct"
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; var trheight = jQuery(obj).children().children('tr.bg1').height()
&amp;nbsp;&amp;nbsp;&amp;nbsp; var tdheight = (parseInt(trheight) * (jQuery(obj).children().children('tr').length-1)) + jQuery(obj).children().children('tr:first').height()
&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery(obj).after("&amp;lt;table cellpadding="0" cellspacing="0" id="setter" style="float: left;"&amp;gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;th align="center" style="height: "+tdheight+"px;" valign="middle"&amp;gt; &amp;lt;input id="upbutton" name="upbutton" type="button" value=" ↑ " /&amp;gt; &amp;lt;br /&amp;gt; &amp;lt;input id="downbutton" name="downbutton" type="button" value=" ↓ " /&amp;gt; &amp;lt;input disabled="disabled" id="setbutton" name="setbutton" onclick="sendRequest( \""+checkIfobject+"\", \""+modelType+"\", \""+clientID+"\", \""+divID+"\" )" style="color: grey;" type="button" value="Set" /&amp;gt; &amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt; &amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;")

&amp;nbsp;&amp;nbsp;&amp;nbsp; var setterwidth = ( 100 * parseFloat(jQuery('#setter').css('width')) / parseFloat(jQuery('#setter').parent().css('width')) );
&amp;nbsp;&amp;nbsp;&amp;nbsp; var tblewidth = (99.7-setterwidth)
&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery(obj).css({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "width" : tblewidth+"%",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "float" : "left"
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; loopingList( obj, checkIfobject );
}
  &lt;/pre&gt;
this function is actually building a html besides the original table. First its shifts it to left side. as we have not defined any width to new table it will take width only what the buttons will take.&lt;br /&gt;
I have also checked the object whether it is table UL or select for future modification in which I will change the code which will be compatible with UL and select also.&lt;br /&gt;
Everying done overhere is just for styling the UI. but main function starts by calling loopingList( obj, checkIfobject ); &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:html"&gt;/*
* This function will actually add the hidden field which will be used for indexing the data
* check_button() is called at the end
*/

function loopingList( obj, checkIfobject ){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var list, mxLength;
&amp;nbsp;&amp;nbsp;&amp;nbsp; switch( checkIfobject ){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case "TaBle":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list = obj.children().children('tr');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxLength = list.length-1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case "UL":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list = obj.children('li');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case "SelEct":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list = obj.children('option');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; list.each(function( index ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var listitem = this;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var jListitem = jQuery(listitem);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jListitem.attr('onClick', "updateList(this)");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jListitem.children('td:first').append("&amp;lt;input class="supportField" id="hidden_"+index+"" type="hidden" value=""+index+"" /&amp;gt;");
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp; check_button( checkIfobject, mxLength );
}
  &lt;/pre&gt;
This will add 1 hidden field to each row for updating the index/ sequence. When this file is called from view first time/ by default its index is set by this function.&lt;br /&gt;
But will be modified later with other function. If in database no value is set and if the user clicks on set button it will save the sequence as per the default setting.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:html"&gt;/*
* This function handles the up and down sorting button clicks on which the actual sorting takes place.
*/

function check_button( checkIfobject, mxLength ){
&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery('#upbutton').click(function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var jListitem = jQuery(".selected_listitem");

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( jListitem.length &amp;gt; 0 ){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery("#setbutton").removeAttr("disabled");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery("#setbutton").removeAttr("style");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var prevlistitem = jListitem.prev();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var prevlistitemIndex = prevlistitem.children("td:first").children("input.supportField").val();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var jListitemIndex = jListitem.children("td:first").children("input.supportField").val();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( jListitemIndex == 1 ){ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var innerhmtl = prevlistitem.html();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prevlistitem.remove();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jListitem.after(""+innerhmtl+"");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jListitem.children("td:first").children("input.supportField").val(prevlistitemIndex);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jListitem.next().children("td:first").children("input.supportField").val(jListitemIndex);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("Select Record for sorting");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery('#downbutton').click(function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var jListitem = jQuery(".selected_listitem");

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( jListitem.length &amp;gt; 0 ){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery("#setbutton").removeAttr("disabled");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery("#setbutton").removeAttr("style");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var nextlistitem = jListitem.next();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var nextlistitemIndex = nextlistitem.children("td:first").children("input.supportField").val();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var jListitemIndex = jListitem.children("td:first").children("input.supportField").val();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( jListitemIndex == mxLength ){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var innerhmtl = nextlistitem.html();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nextlistitem.remove();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jListitem.before(""+innerhmtl+"");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jListitem.children("td:first").children("input.supportField").val(nextlistitemIndex);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jListitem.prev().children("td:first").children("input.supportField").val(jListitemIndex);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("Select Record for Sorting");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

}
  &lt;/pre&gt;
This above function handles the sorting onclick of up and down buttons.&lt;br /&gt;
It also considers that at least 1 row should be selected for sorting else it will show alert for selecting record.&lt;br /&gt;
&lt;br /&gt;
Finally a main roll function which sends the ajax request to controller's action reset_sequence&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:html"&gt;function sendRequest( checkIfobject, modelType, clientID, divID ){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var jListitem = jQuery(".selected_listitem");
&amp;nbsp;&amp;nbsp;&amp;nbsp; if( jListitem.length &amp;gt; 0 ){
&amp;nbsp;&amp;nbsp;&amp;nbsp;   var list = jQuery(divID).children().children('tr');
&amp;nbsp;&amp;nbsp;&amp;nbsp;   var sequences = []

&amp;nbsp;&amp;nbsp;&amp;nbsp;   list.each(function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var listitem = this;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var jListitem = jQuery(listitem);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var indNum = list.index(listitem);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( indNum &amp;gt; 0 ){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var id = jListitem.children("td:first").children("input.supportFieldID").val();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sequence = jListitem.children("td:first").children("input.supportField").val();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sequences.push([id,sequence]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;   });&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp;   jQuery.ajax({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: 'get',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: '/reset_sequence',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'sequences[]' : sequences,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "model_type" : modelType,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "client_id" : clientID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; success: function(transform){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //window.location.reload();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.location.href="/manage_company_utilities/"+modelType;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;   });
&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("Select Record for Sorting");
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
  &lt;/pre&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-3302892501881396287?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/xduKAQwQruQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/xduKAQwQruQ/sequencing-data-in-rails-application.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>1</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2011/09/sequencing-data-in-rails-application.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-9100584729569121592</guid><pubDate>Sun, 04 Sep 2011 07:46:00 +0000</pubDate><atom:updated>2011-09-04T00:46:30.235-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">css</category><title>Woking with position:absolute in CSS</title><description>position:absolute is really nice when we are positioning some div through CSS. But we need to understand how to use it properly. When we add position:absolute we also need to take care of its behaviour. Just adding this does not make any difference, then we also need to add  margin  or  directly(top, right, bottom and left)  positions.&lt;br /&gt;&lt;br /&gt;Adding top, right,  bottom or  left  floats the entire div and works like a layer. It may overlap on some other div. So we need to add some px or em to make it float on the right position.&lt;br /&gt;For Example: {position : absolute; top:100px; z-index:2}&lt;br /&gt;When we added top:100px it took right from the body top. Even if we place this div at the bottom of the layout it will still float the top after leaving 100px.&lt;br /&gt;This is usually used for popups.&lt;br /&gt;&lt;br /&gt;Now about the margin.&lt;br /&gt;margin will keep the div where it is embedded in the layout. It will never make div to float anywhere.&lt;br /&gt;For Example{position:absolute; margin:100px 0 0 0}&lt;br /&gt;This will keep the div at its place. only it will make it leave 100px at the top of his position. nothing else.&lt;br /&gt;&lt;br /&gt;Working together with both(margin and direct positioning)&lt;br /&gt;Mostly when we need to take any div to the center, we can use position:absolute.&lt;br /&gt;As in my previous post we saw how to add popup.&lt;br /&gt;We used&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;#hiddendiv{&lt;br /&gt;position:absolute;&lt;br /&gt;background: #fff;&lt;br /&gt;top:50%;&lt;br /&gt;left:50%;&lt;br /&gt;margin: -100px 0 0 -200px;&lt;br /&gt;width: 400px;&lt;br /&gt;height: 200px;&lt;br /&gt;border: 4px solid #CB6D23}&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;Here we can see from top:50% and left:50%. So the div will float 50% of each side we want. Then in margin I added in negative the half of its height for top and half of its width from left. This pulls the div to top and left half-half of its height and width and make it to the center of the layout.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-9100584729569121592?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/TkT6rlxNwuc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/TkT6rlxNwuc/woking-with-positionabsolute-in-css.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/woking-with-positionabsolute-in-css.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-7409610330969640605</guid><pubDate>Sun, 04 Sep 2011 07:43:00 +0000</pubDate><atom:updated>2011-09-04T00:43:00.242-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>Creating a static site in ruby</title><description>Creating a static site is now very easy in ruby, Just need to install the gem.&lt;br /&gt;The article about creating the site can be found at &lt;a href="http://articles.sitepoint.com/article/jekyll-sites-made-simple/1" target="blank"&gt;sitepoint.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After creating the site step by step as given in the article.&lt;br /&gt;But I was not able to get the previous and next links in the show page/ main post page except the index as added in the article.&lt;br /&gt;&lt;br /&gt;So added the following code to the _layouts/post.html&lt;blockquote&gt;&amp;lt;div id="navigation"&amp;gt;&lt;blockquote&gt; {% if page.previous %}&lt;blockquote&gt;&amp;lt;div id="previous"&amp;gt;&lt;br /&gt;          &amp;lt;&amp;lt; &amp;lt;a href='{{ page.previous.url }}'&amp;gt;{{ page.previous.title }}&amp;lt;/a&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;/blockquote&gt;{% endif %}&lt;/blockquote&gt; &lt;blockquote&gt;{% if page.next %}&lt;blockquote&gt;&amp;lt;div id="next"&amp;gt;&lt;br /&gt;          &amp;lt;a href='{{ page.next.url }}'&amp;gt;{{ page.next.title }}&amp;lt;/a&amp;gt; &amp;gt;&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;/blockquote&gt;{% endif %}&lt;/blockquote&gt; &amp;lt;/div&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;And the navigation we need to add in the needs to be added with the whole url for example:&lt;blockquote&gt;&amp;lt;div id="site-navigation"&gt;&lt;br /&gt;    &amp;lt;a href="http://localhost:4000/index.html"&amp;gt; Home Page &amp;lt;/a&amp;gt; |&lt;br /&gt;    &amp;lt;a href="http://localhost:4000/archive.html"&amp;gt; Archive &amp;lt;/a&amp;gt; |&lt;br /&gt;    &amp;lt;a href="http://localhost:4000/about.html"&amp;gt; About &amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/div&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-7409610330969640605?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/X7lBV-kQUro" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/X7lBV-kQUro/creating-static-site-with-ruby.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/11/creating-static-site-with-ruby.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-7001894579675576255</guid><pubDate>Wed, 24 Feb 2010 06:02:00 +0000</pubDate><atom:updated>2010-08-19T10:47:36.486-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Installing Sphinx for ubuntu</title><description>I installed Thinking Sphinx by following the step posted in &lt;a href="http://www.hackido.com/2009/01/install-sphinx-search-on-ubuntu.html" target="blank"&gt;hackido.com&lt;/a&gt;&lt;br /&gt;This helped me alot simple and fast installation.&lt;br /&gt;For mysql the thinking sphinx was running cool, but there was a problem I faced as we were not using mysql, we were using &lt;b&gt;postgresql&lt;/b&gt; for one of our project.&lt;br /&gt;So I followed the post by &lt;a href="http://freelancing-god.github.com/ts/en/installing_sphinx.html" target="blank"&gt;freelancing-god.github.com&lt;/a&gt;.&lt;br /&gt;&lt;pre class="brush:shell"&gt;./configure --with-pgsql&lt;br /&gt;./configure --with-pgsql=/usr/local/include/postgresql&lt;br /&gt;pg_config --pkgincludedir&lt;br /&gt;make&lt;br /&gt;sudo make install&lt;/pre&gt;&lt;br /&gt;And then I indexed the Thinking Sphinx for project and started the same, which was successfully started.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-7001894579675576255?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/_wNeOA9lZNU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/_wNeOA9lZNU/installing-sphinx-for-ubuntu.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2010/02/installing-sphinx-for-ubuntu.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-920956546038100108</guid><pubDate>Tue, 23 Feb 2010 04:40:00 +0000</pubDate><atom:updated>2011-09-10T02:01:31.404-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Installing netbeans on Ubuntu</title><description>Installing netbeans on Ubuntu is very easy. I installed it on Karmic(Ubuntu 9.10)&lt;br /&gt;For netbeans we need to add sun-java6-jdk and the command for that is &lt;pre class="brush:shell"&gt;sudo apt-get install sun-java6-jdk&lt;/pre&gt;&lt;br /&gt;Once the sun-java6-jdk is installed we then start to install netbeans and there are 2 steps for it, both are very easy.&lt;br /&gt;First just with one command which is &lt;pre class="brush:shell"&gt;sudo apt-get install netbeans&lt;/pre&gt; or even we can install that from Synaptic Package Manager. Just search for netbeans which will also find dependencies and install tha same what ever required. The problem I faced for this installation was that I didnt get the latest version of netbeans.&lt;br /&gt;Second is we go to the &lt;a href="http://netbeans.org/index.html" target="blank"&gt;netbeans.org&lt;/a&gt; download the netbeans from &lt;a href="http://netbeans.org/downloads/index.html" target="blank"&gt;download page&lt;/a&gt;. This page gives you the list of technologies for which you need the software. Just see which ever you need. For me it was for ruby.&lt;br /&gt;Once you are complete with download go to the folder where your .sh file of netbeans is downloaded and then type &lt;br /&gt;&lt;pre class="brush:shell"&gt;chmod +x (filename).sh&lt;/pre&gt;&lt;br /&gt;Once the file is being extracted go to the Home folder. There we can find the netbeans-(version_no) for me it was &lt;b&gt;netbeans-6.8&lt;/b&gt;. After that go in the bin folder and run&lt;br /&gt;&lt;pre class="brush:shell"&gt;./netbeans&lt;/pre&gt;&lt;br /&gt;This will start the netbeans and will also create a desktop shortcut.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-920956546038100108?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/McM_Hr2aD70" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/McM_Hr2aD70/installing-netbeans-on-ubuntu.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2010/02/installing-netbeans-on-ubuntu.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-2736944799027802100</guid><pubDate>Sun, 21 Feb 2010 08:08:00 +0000</pubDate><atom:updated>2011-09-04T00:41:34.103-07:00</atom:updated><title>Kyle Bradshaw's JQuery Best Practices</title><description>Check out this SlideShare Presentation: &lt;div style="width:425px;text-align:left" id="__ss_2000441"&gt;&lt;a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/hasantayyar/kyle-bradshaws-jquery-best-practices" title="Kyle Bradshaw&amp;#39;s JQuery Best Practices"&gt;Kyle Bradshaw&amp;#39;s JQuery Best Practices&lt;/a&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquerybestpractices1-090915093743-phpapp01&amp;stripped_title=kyle-bradshaws-jquery-best-practices" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquerybestpractices1-090915093743-phpapp01&amp;stripped_title=kyle-bradshaws-jquery-best-practices" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;View more &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/hasantayyar"&gt;Hasan Tayyar BESIK&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-2736944799027802100?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/v5tlPOBddiE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/v5tlPOBddiE/kyle-bradshaw-jquery-best-practices.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2010/02/kyle-bradshaw-jquery-best-practices.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-156290030051290229</guid><pubDate>Wed, 17 Feb 2010 06:16:00 +0000</pubDate><atom:updated>2010-08-19T11:07:52.249-07:00</atom:updated><title>Using Fastercsv to import data</title><description>Fastercsv is best for importing data in ruby on rails application.&lt;br /&gt;For this we just need to add the gem.&lt;br /&gt;&lt;pre class="brush:shell"&gt;gem install fastercsv&lt;/pre&gt;&lt;br /&gt;For importing data first we will need to upload the .csv file to the server/ rails application. Then we can call the data very easily. For uploading the file we need to take look at the step by step tutorial explained by &lt;a href="http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-file-uploading.htm" target="blank"&gt;tutorialpoint.com&lt;/a&gt;&lt;br /&gt;For e.g. Consider the we need to upload the marks for a specific division and exam for students.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;In view&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush:html"&gt;&lt;% form_tag ({:action =&gt; 'uploadFile'}, :multipart =&gt; true) do %&gt;&lt;br /&gt;  &lt;p&gt;&lt;label for="upload_file"&gt;Upload CSV for &lt;br /&gt;  &lt;%= @division.with_standard %&gt;&lt;/label&gt; : &lt;br /&gt;  &lt;%= file_field 'upload', 'datafile' %&gt;&lt;br /&gt;  &lt;%= hidden_field_tag "division_id", params[:division_id] %&gt;&lt;br /&gt;  &lt;%= hidden_field_tag "exam_id", params[:exam_id] %&gt;&lt;/p&gt;&lt;br /&gt;  &lt;%= submit_tag "Upload" %&gt; &lt;br /&gt;&lt;% end %&gt;&lt;/pre&gt;&lt;br /&gt;Here I am sending the division_id and exam_id as parameters.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;In Controller&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush:rails"&gt;def uploadFile&lt;br /&gt;  post = Exam.upsave(params[:upload], params[:division_id], params[:exam_id])&lt;br /&gt;  flash[:ok] = "data imported"&lt;br /&gt;  redirect_to enter_marks_path&lt;br /&gt;end&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;In Model&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush:rails"&gt;require "fastercsv"&lt;br /&gt;def self.upsave(upload, divid, exam)&lt;br /&gt;  @division = Division.find(divid)&lt;br /&gt;  name =  upload['datafile'].original_filename&lt;br /&gt;  directory = "public/data"&lt;br /&gt;  path = File.join(directory, name)&lt;br /&gt;  File.open(path, "wb") { |f| f.write(upload['datafile'].read) }&lt;br /&gt;  # more code to be added&lt;br /&gt;end&lt;/pre&gt;&lt;br /&gt;The above code is same as given in the tutorialpoint.com to upload the .csv file to the data folder in public file.&lt;br /&gt;Now The problem is that different divisions can have different subjects so, in the method defined above we will need to add the following code.&lt;br /&gt;We are going to declare one local variable.&lt;br /&gt;&lt;pre class="brush:rails"&gt;num = 0&lt;br /&gt;  m = []&lt;br /&gt;  FasterCSV.foreach(path) do |col|&lt;br /&gt;   if num == 0&lt;br /&gt;   # finding the col values&lt;br /&gt;    col.each do |c|&lt;br /&gt;    # unless the column value is "R.No"(which is a roll no of student) find the subject using the abbreviation of that subject&lt;br /&gt;      unless c == "R.No"&lt;br /&gt;       subj = Subject.first(:conditions =&gt; ["abbreviation = '#{c}'"])&lt;br /&gt;       if subj.present?&lt;br /&gt;        m.push(subj.id)&lt;br /&gt;       end&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  else&lt;br /&gt;  # other code will come here&lt;br /&gt;  num += 1&lt;br /&gt;end&lt;/pre&gt;&lt;br /&gt;Subjects table has name and abbreviations columns, so while creating the .csv file user needs to use "R.No" as roll no of the student and subjects in the divisions using the abbreviations.&lt;br /&gt;In the above code I am adding the subject's id in the "m" array declared before.&lt;br /&gt;Now in the else we will import the data&lt;br /&gt;&lt;pre class="brush:rails"&gt;if col.size &gt; 1&lt;br /&gt;  row_count = 1&lt;br /&gt;  m.each do |subjectid|&lt;br /&gt;    @division.subjects.each do |subject|&lt;br /&gt;    if subject.id == subjectid&lt;br /&gt;    # find the student with roll no&lt;br /&gt;    student = Student.first(:conditions =&gt; ("roll_no = #{row[0]} AND division_id = #{@division.id}"))&lt;br /&gt;    # find the mark for student&lt;br /&gt;    mark = Mark.first(:conditions =&gt; ["student_id = #{student.id} AND subject_id = #{subjectid} AND division_id = #{divid} AND exam_id = #{exam}"])&lt;br /&gt;      if mark.present?&lt;br /&gt;        # we added row_count as a local variable&lt;br /&gt;        mark.update_attribute(:written, row[row_count])&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;  row_count += 1&lt;br /&gt; end&lt;br /&gt;end&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-156290030051290229?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/h3cO1nbTyS0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/h3cO1nbTyS0/using-fastercsv-to-import-data.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2010/02/using-fastercsv-to-import-data.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-9133271036767463697</guid><pubDate>Mon, 28 Dec 2009 13:35:00 +0000</pubDate><atom:updated>2009-12-30T22:07:19.428-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>74 Quality Ruby on Rails Resources and Tutorials</title><description>There are so many resources and tutorials available on net for a very popular programming language ruby on rails as its open source, but many people don't know which are the best sites to follow.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.softwaredeveloper.com/features/74-ruby-on-rails-resources-tutorials-050207/" target="blank"&gt;Softwaredeveloper.com&lt;/a&gt; is providing list or we can say guide of 74 Quality Ruby on Rails Resources and Tutorials in one place. &lt;br /&gt;Cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-9133271036767463697?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/hUyHiUSqhRM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/hUyHiUSqhRM/74-quality-ruby-on-rails-resources-and.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/12/74-quality-ruby-on-rails-resources-and.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-7966004479186628819</guid><pubDate>Mon, 28 Dec 2009 13:33:00 +0000</pubDate><atom:updated>2009-12-30T22:07:48.920-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>Installing gem ferret without nmake error</title><description>Gem's like ferret, ruby-debug throws nmake errors while installing those. Like I got when I was installing ferret&lt;br /&gt;&lt;blockquote&gt;$ gem install ferret&lt;br /&gt;Building native extensions.  This could take a while...&lt;br /&gt;ERROR:  Error installing ferret:&lt;br /&gt;        ERROR: Failed to build gem native extension.&lt;br /&gt;&lt;br /&gt;c:/ruby/bin/ruby.exe extconf.rb&lt;br /&gt;creating Makefile&lt;br /&gt;&lt;br /&gt;nmake&lt;br /&gt;'nmake' is not recognized as an internal or external command,&lt;br /&gt;operable program or batch file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/ferret-0.11.6&lt;br /&gt;for inspection.&lt;br /&gt;Results logged to c:/ruby/lib/ruby/gems/1.8/gems/ferret-0.11.6/ext/gem_make.out&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;To avoid this go to &lt;a href="http://rubyforge.org/frs/?group_id=1028" target="blank"&gt;rubyforge.com&lt;/a&gt; and then just download gem file which name holds "mswin32", the gem will be installed with no nmake errors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-7966004479186628819?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/GdBuwJDRn0s" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/GdBuwJDRn0s/installing-gem-ferret-without-nmake.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>1</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/12/installing-gem-ferret-without-nmake.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-7317793057432428668</guid><pubDate>Sat, 28 Nov 2009 07:13:00 +0000</pubDate><atom:updated>2009-11-28T23:11:16.502-08:00</atom:updated><title>Regular Expressions Editor</title><description>Understanding regular expressions is difficult and coding that is more.&lt;br /&gt;But what if we have plenty of resources available, like &lt;a href="http://regexlib.com/" target="blank"&gt;regexlib.com&lt;/a&gt; where we can find many libraries for regular expressions at one place.&lt;br /&gt;&lt;br /&gt;There are also other testing tools like &lt;a href="http://www.pagecolumn.com/tool/regtest.htm" target="blank"&gt;regtest&lt;/a&gt; AND &lt;br /&gt;&lt;b&gt;Rubular&lt;/b&gt;, which is a Ruby-based regular expression editor, a very handy tool and can be found at &lt;a href="http://www.rubular.com/" target="blank"&gt;rubular&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="display:none"&gt;http://www.javascriptkit.com/javatutors/redev.shtml&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-7317793057432428668?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/xOHoGCXyx4E" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/xOHoGCXyx4E/regular-expressions-editor.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/11/regular-expressions-editor.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-3662180892451201673</guid><pubDate>Fri, 20 Nov 2009 05:52:00 +0000</pubDate><atom:updated>2009-12-24T05:38:51.227-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>Rails Best Practices</title><description>Rails best practices is really a good gem to understand and modify your rails project according to the rails real environment, where your project's performance increases.&lt;br /&gt;Just run &lt;blockquote&gt;gem install rails_best_practices&lt;/blockquote&gt; Then go in to the project and just run this command &lt;blockquote&gt;rails_best_practices .&lt;/blockquote&gt; This will take some very small time and let you know what are the best practices you should take and move your code to other place to make your project run at faster speed. And once you get the list just check out this SlideShare Presentation: &lt;div style="width:425px;text-align:left" id="__ss_2334123"&gt;&lt;a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/ihower/rails-best-practices" title="Rails Best Practices"&gt;Rails Best Practices&lt;/a&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rails-best-practices-091024015011-phpapp01&amp;stripped_title=rails-best-practices" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rails-best-practices-091024015011-phpapp01&amp;stripped_title=rails-best-practices" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;View more &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/"&gt;documents&lt;/a&gt; from &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/ihower"&gt;Wen-Tien Chang&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-3662180892451201673?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/s5RZQy-4kFk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/s5RZQy-4kFk/rails-best-practices.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/11/rails-best-practices.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-1660013707626571434</guid><pubDate>Wed, 19 Aug 2009 17:40:00 +0000</pubDate><atom:updated>2009-11-28T00:12:12.608-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">html</category><title>Using marquee</title><description>Code of marquee to scroll images&lt;br /&gt;&lt;br /&gt;&amp;lt;ul&amp;gt;&lt;br /&gt;&amp;lt;marquee  behavior="alternate" direction="left" scrollamount="1" align="center" &amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt; &amp;lt;img src="/images/image1.png" alt="image1" /&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt; &amp;lt;img src="/images/image2.png" alt="image2" /&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt; &amp;lt;img src="/images/image3.png" alt="image3" /&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt; &amp;lt;img src="/images/image4.png" alt="image4" /&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt; &amp;lt;img src="/images/image5.png" alt="image5" /&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;/marquee&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;&lt;br /&gt;In CSS&lt;br /&gt;ul li{margin:0; padding:0; display:inline; float:left;}&lt;br /&gt;&lt;br /&gt;If we start increasing the scrollamout of the marquee the speed of the content in the marquee will rise.&lt;br /&gt;&lt;br /&gt;Other marquee attributes can be found at &lt;a href="http://www.blooberry.com/indexdot/html/tagpages/m/marquee.htm" target="blank"&gt;blooberry.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="merawalamarquee" style="display:none"&gt;&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt; #merawalamarquee ul{margin:0; padding:0; height:120px;}&lt;br /&gt; #merawalamarquee ul li{margin:0; padding:0; display:inline; float:left;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;marquee behavior="alternate" direction="left" scrollamount="1" align="center"&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oJ-e4hqLqv8/SljcY02m78I/AAAAAAAAABc/8j70ADVCVqc/s1600-h/image1.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://4.bp.blogspot.com/_oJ-e4hqLqv8/SljcY02m78I/AAAAAAAAABc/8j70ADVCVqc/s320/image1.png" alt="" id="BLOGGER_PHOTO_ID_5357274075819864002" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_oJ-e4hqLqv8/Sljc0C67wDI/AAAAAAAAABk/6mBUXY8hqAo/s1600-h/image2.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://2.bp.blogspot.com/_oJ-e4hqLqv8/Sljc0C67wDI/AAAAAAAAABk/6mBUXY8hqAo/s320/image2.png" alt="" id="BLOGGER_PHOTO_ID_5357274543452569650" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_oJ-e4hqLqv8/SljdAs9wOoI/AAAAAAAAABs/3Pdpj8buiSQ/s1600-h/image3.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://1.bp.blogspot.com/_oJ-e4hqLqv8/SljdAs9wOoI/AAAAAAAAABs/3Pdpj8buiSQ/s320/image3.png" alt="" id="BLOGGER_PHOTO_ID_5357274760897116802" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_oJ-e4hqLqv8/SljdEl42GxI/AAAAAAAAAB0/NKpHk3sbhBs/s1600-h/image4.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://3.bp.blogspot.com/_oJ-e4hqLqv8/SljdEl42GxI/AAAAAAAAAB0/NKpHk3sbhBs/s320/image4.png" alt="" id="BLOGGER_PHOTO_ID_5357274827716958994" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_oJ-e4hqLqv8/SljdIsNRAyI/AAAAAAAAAB8/yXnwoQL56l0/s1600-h/image5.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://2.bp.blogspot.com/_oJ-e4hqLqv8/SljdIsNRAyI/AAAAAAAAAB8/yXnwoQL56l0/s320/image5.png" alt="" id="BLOGGER_PHOTO_ID_5357274898132697890" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oJ-e4hqLqv8/SljdMblIAPI/AAAAAAAAACE/WSJ3wd-t_BA/s1600-h/image6.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://4.bp.blogspot.com/_oJ-e4hqLqv8/SljdMblIAPI/AAAAAAAAACE/WSJ3wd-t_BA/s320/image6.png" alt="" id="BLOGGER_PHOTO_ID_5357274962388844786" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_oJ-e4hqLqv8/SljdQsz1-7I/AAAAAAAAACM/yQoAwgtrIRs/s1600-h/image7.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://2.bp.blogspot.com/_oJ-e4hqLqv8/SljdQsz1-7I/AAAAAAAAACM/yQoAwgtrIRs/s320/image7.png" alt="" id="BLOGGER_PHOTO_ID_5357275035733457842" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_oJ-e4hqLqv8/SljdVanORjI/AAAAAAAAACU/jQTH6-xEitc/s1600-h/image8.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://2.bp.blogspot.com/_oJ-e4hqLqv8/SljdVanORjI/AAAAAAAAACU/jQTH6-xEitc/s320/image8.png" alt="" id="BLOGGER_PHOTO_ID_5357275116748031538" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_oJ-e4hqLqv8/SljdZct7c9I/AAAAAAAAACc/l9o9czI0dEk/s1600-h/image9.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 100px;" src="http://3.bp.blogspot.com/_oJ-e4hqLqv8/SljdZct7c9I/AAAAAAAAACc/l9o9czI0dEk/s320/image9.png" alt="" id="BLOGGER_PHOTO_ID_5357275186032505810" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/marquee&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Firefox don't show images&lt;br /&gt;&lt;br /&gt;Firefox is really cool browser for developers as it gives us web developers toolbar, so I always prefer to use firefox.&lt;br /&gt;As I was working on showing images in marquee. I tried to put the list of images in marquee. The code you can find in my previous post.&lt;br /&gt;The problem I faced that the images in that list were not getting displayed.&lt;br /&gt;But when i crossed check it in other browsers, those were displaying the images + scrolling effect through marquee.This really confused me why is that happening.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-1660013707626571434?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/FItHxhCKmA4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/FItHxhCKmA4/using-marquee-to-scroll-images.html</link><author>noreply@blogger.com (Supriya Surve)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_oJ-e4hqLqv8/SljcY02m78I/AAAAAAAAABc/8j70ADVCVqc/s72-c/image1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/08/using-marquee-to-scroll-images.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-2625202287542521116</guid><pubDate>Wed, 12 Aug 2009 08:12:00 +0000</pubDate><atom:updated>2009-11-28T23:24:38.939-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">vista</category><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>undefined method 'collect' after installing one click installer</title><description>After Installing ruby with one click installer never forget to update the gems:&lt;br /&gt;&lt;blockquote&gt;gem install rubygems-update&lt;br /&gt;gem update --system &lt;/blockquote&gt;&lt;br /&gt;If you don't do so you will get bunch of errors at gitbash/ command prompt what ever you use&lt;br /&gt;&lt;blockquote&gt;the error will be for sh.exe &lt;br /&gt;&lt;br /&gt;rake aborted!&lt;br /&gt;undefined method `collect' for #&lt;gem::version::requirement:0x493a43c&gt;. . . . . . . .&lt;/blockquote&gt;&lt;br /&gt;You can see full trace by running task with --trace&lt;br /&gt;&lt;br /&gt;After getting these message if you update the gems and the projects will start running properly and you will get something like this&lt;br /&gt;&lt;blockquote&gt;Deprecation Notices:&lt;br /&gt;&lt;br /&gt;* Bulk index update is no longer supported (the code currently remains, but not  the tests)&lt;br /&gt;* Gem::manage_gems was removed in 1.3.3.&lt;br /&gt;* Time::today was removed in 1.3.3.&lt;br /&gt;&lt;br /&gt;&amp;lt;/gem::version::requirement:0x493a43c&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="display:none"&gt;http://www.getontracks.org/forums/viewthread/402/&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-2625202287542521116?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/6Y2qUFu893c" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/6Y2qUFu893c/undefined-method-collect.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/08/undefined-method-collect.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-1290349317771959865</guid><pubDate>Fri, 17 Jul 2009 10:09:00 +0000</pubDate><atom:updated>2009-07-24T10:41:51.632-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><title>onchange and IE</title><description>onChange event handler, not supported by Internet Explorer, which is really bad.&lt;br /&gt;As I was using checkbox, which has to hide or show other div on true/ false when checkbox changes its behaviour.&lt;br /&gt;&lt;br /&gt;After a study I found that IE waits to loose the focus from the checkbox. As soon as I click on other object or on the page to make it work.&lt;br /&gt;&lt;br /&gt;You can see working example at &lt;a href="http://krijnhoetmer.nl/stuff/javascript/checkbox-onchange/" target="_blank"&gt;krijnhoetmer.nl&lt;/a&gt;&lt;br /&gt;In &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/958a24b7-775e-434b-9fd4-58f72ecbb759/" target="_blank"&gt;MSDN Forum&lt;/a&gt; they have used &lt;b&gt;setTimeout&lt;/b&gt; Window Function. But this didn't work for me.&lt;br /&gt;&lt;br /&gt;The only solution worked for me was replacing onChange with onClick event handler.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-1290349317771959865?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/GffObRWmkY4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/GffObRWmkY4/onchange-and-ie.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/07/onchange-and-ie.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-1320871378964819153</guid><pubDate>Thu, 16 Jul 2009 13:39:00 +0000</pubDate><atom:updated>2009-12-30T22:07:58.780-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">css</category><title>PNG in IE6</title><description>PNG image format is so useful while making images transparent, but the question arrives that &lt;b&gt;whether it supports all the browsers or not&lt;/b&gt;. Well latest browsers do support this format but the problem occurs when we deal with IE6.&lt;br /&gt;Even though we now have IE8, still usage of IE6 is 14.9%.&lt;br /&gt;&lt;br /&gt;You can find the latest &lt;b&gt;Browser Statistics Month by Month&lt;/b&gt; at &lt;a href="http://www.w3schools.com/browsers/browsers_stats.asp" target="_blank"&gt;w3schools&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For that we always use the following available IE6 Hack&lt;br /&gt;In CSS&lt;br /&gt;&lt;div class="code"&gt;&lt;blockquote&gt;#trans-content{&lt;blockquote&gt;background:url(section.png) repeat; &lt;br /&gt; width:100%; &lt;br /&gt; height:260px; &lt;br /&gt; margin:0; &lt;br /&gt; padding:0; }&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;and &lt;div class="code"&gt;&lt;blockquote&gt;* html #trans-content{background-image:none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='section.png', sizingMethod='scale');}&lt;/blockquote&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-1320871378964819153?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/VPp7N2R9kIs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/VPp7N2R9kIs/png-in-ie6.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/07/png-in-ie6.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-931316638532825553</guid><pubDate>Tue, 23 Jun 2009 08:56:00 +0000</pubDate><atom:updated>2009-07-13T08:26:20.172-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">css</category><title>min-height behaviour in firefox 3.0</title><description>Min-height property is very useful for designing a site. Although it was not working in IE6 but hack was available. And even if there was height specified it expands automatically after gettign more than that height.&lt;br /&gt;I have Firefox 3.0.11 installed and when I checked "#wrapper{min-height:100%}" it didn't work at all. That was strange as I used this in my previous designs.&lt;br /&gt;But when I replace the 100% with 400px it started working properly.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-931316638532825553?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/_7_MvTGm1KE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/_7_MvTGm1KE/min-height-behaviour-in-firefox-30.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/min-height-behaviour-in-firefox-30.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-4338207054518793369</guid><pubDate>Sun, 21 Jun 2009 06:15:00 +0000</pubDate><atom:updated>2009-06-20T23:27:44.142-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>Simple Restriction while deleting a record in rails</title><description>Adding  validations to rails application is really simple and we also get help from rails api.&lt;br /&gt;We can also delete the dependent with a record.&lt;br /&gt;&lt;br /&gt;But what if we don't want to delete a record when we have dependent.&lt;br /&gt;I got this solution from the post of &lt;a href="http://sachindnaik.blogspot.com/2009/06/simple-restriction-while-deleting.html"&gt;Sachin&lt;/a&gt;.&lt;br /&gt;Just took dependent and if there is no dependent only then delete this record.&lt;br /&gt;&lt;br /&gt;Simple and quick solution. Thanks Sachin.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-4338207054518793369?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/n1E1V1NMKRo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/n1E1V1NMKRo/simple-restriction-while-deleting.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/simple-restriction-while-deleting.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-599937615685867278</guid><pubDate>Thu, 18 Jun 2009 12:26:00 +0000</pubDate><atom:updated>2009-07-07T04:13:32.273-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><title>Javascript Page flip effect</title><description>Its really cool when we watch the page flip effect in Flash.&lt;br /&gt;Flash and actionscript can just do anything.&lt;br /&gt;For example &lt;a href="http://www.flashpageflip.com/" target="_blank"&gt;flashpageflip.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_oJ-e4hqLqv8/Sjo1PHtZOPI/AAAAAAAAABE/Cfjko4TJTuE/s1600-h/pageflip.jpg"&gt;&lt;img style="cursor: pointer; width: 300px; height: 232px;" src="http://2.bp.blogspot.com/_oJ-e4hqLqv8/Sjo1PHtZOPI/AAAAAAAAABE/Cfjko4TJTuE/s320/pageflip.jpg" alt="" id="BLOGGER_PHOTO_ID_5348646041339640050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;They are also giving facility to download.&lt;br /&gt;&lt;br /&gt;But what if we get not exactly but something similar in javascript.&lt;br /&gt;You can get the demo as well as code at &lt;a href="http://www.coastworx.com/bookflip.php" target="blank"&gt;coastworx.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_oJ-e4hqLqv8/Sjo1VTdUIBI/AAAAAAAAABM/f-lnk8J-k2s/s1600-h/bookflip.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 193px;" src="http://2.bp.blogspot.com/_oJ-e4hqLqv8/Sjo1VTdUIBI/AAAAAAAAABM/f-lnk8J-k2s/s320/bookflip.jpg" alt="" id="BLOGGER_PHOTO_ID_5348646147572637714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Or even &lt;span dc="http://purl.org/dc/elements/1.1/" property="dc:title"&gt;Javascript Pageflip&lt;/span&gt; by &lt;a cc="http://creativecommons.org/ns#" href="http://option8.com/" property="cc:attributionName" rel="cc:attributionURL" target="_blank"&gt;Charles Mangin&lt;/a&gt; at his &lt;a href="http://clickheredammit.com/pageflip/" target="_blank"&gt;site&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oJ-e4hqLqv8/Sjss27Yn4dI/AAAAAAAAABU/Y8SX1Jn9M4M/s1600-h/bookflip2.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 214px;" src="http://4.bp.blogspot.com/_oJ-e4hqLqv8/Sjss27Yn4dI/AAAAAAAAABU/Y8SX1Jn9M4M/s320/bookflip2.jpg" alt="" id="BLOGGER_PHOTO_ID_5348918304598122962" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-599937615685867278?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/qdDCmaVToAc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/qdDCmaVToAc/javascript-page-flip-effect.html</link><author>noreply@blogger.com (Supriya Surve)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_oJ-e4hqLqv8/Sjo1PHtZOPI/AAAAAAAAABE/Cfjko4TJTuE/s72-c/pageflip.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/javascript-page-flip-effect.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-2462832093483022231</guid><pubDate>Sun, 14 Jun 2009 08:42:00 +0000</pubDate><atom:updated>2009-06-21T02:08:21.959-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>Easy Field Validation with Prototype</title><description>Giving validations in rails applications is really simple and nice, but if we can display validations with cool javascript effect, the application really looks effective.&lt;br /&gt;&lt;br /&gt;This is possible with using prototype library and adding validations.js  by &lt;a rel="nofollow" href="http://tetlaw.id.au/" target="_blank"&gt;Andrew Tetlaw&lt;/a&gt;. You can find &lt;a href="http://tetlaw.id.au/view/blog/really-easy-field-validation-with-prototype/" target="_blank"&gt;documentation and demo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The code  really works fine and with really nice effects. If any one wants to add image, can alter the code little bit and change the validation div to the span in javascript itself and add image_tag. We can also add our own validations.&lt;br /&gt;&lt;br /&gt;Only problem occurs when using calendar_date_select plugin and error hits. calendar_date_select link stops working.&lt;br /&gt;If not using calendar_date_select these validations rocks. I will definitely prefer to use these.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-2462832093483022231?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/BzsxmwNyCdE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/BzsxmwNyCdE/simple-validations-by-prototype.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/simple-validations-by-prototype.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-7633992805930505946</guid><pubDate>Wed, 10 Jun 2009 17:32:00 +0000</pubDate><atom:updated>2009-07-07T04:11:27.699-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">flash</category><title>Setting up flash for local as well as network access</title><description>Publishing the flash file gives only 2 option whether we want to access network or local but what if we want access both?&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_oJ-e4hqLqv8/Si_weHbj3HI/AAAAAAAAAA0/yjV9lGX8B4s/s1600-h/flash1.png"&gt;&lt;img style="cursor: pointer; width: 216px; height: 320px;" src="http://1.bp.blogspot.com/_oJ-e4hqLqv8/Si_weHbj3HI/AAAAAAAAAA0/yjV9lGX8B4s/s320/flash1.png" alt="" id="BLOGGER_PHOTO_ID_5345755682893454450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Flash files setting up for local and network access is very simple.&lt;br /&gt;Just go to &lt;a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html" target="_blank"&gt;Flash Player Setting Manager&lt;/a&gt; and set the global settings.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oJ-e4hqLqv8/Si_vly_7PiI/AAAAAAAAAAs/IeUrRKJV_wM/s1600-h/flash.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 220px;" src="http://4.bp.blogspot.com/_oJ-e4hqLqv8/Si_vly_7PiI/AAAAAAAAAAs/IeUrRKJV_wM/s320/flash.png" alt="" id="BLOGGER_PHOTO_ID_5345754715336162850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Add the location and select the option from given radio buttons and you are done.&lt;br /&gt;Now you can access not only network but also can add local files.&lt;br /&gt;This will help for adding functionality like downloading files or photo gallery.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-7633992805930505946?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/Hj6zzWHkDRM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/Hj6zzWHkDRM/setting-up-flash-for-local-as-well-as.html</link><author>noreply@blogger.com (Supriya Surve)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_oJ-e4hqLqv8/Si_weHbj3HI/AAAAAAAAAA0/yjV9lGX8B4s/s72-c/flash1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/setting-up-flash-for-local-as-well-as.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-4057698799355049218</guid><pubDate>Mon, 08 Jun 2009 11:11:00 +0000</pubDate><atom:updated>2009-06-21T02:11:29.525-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>Using Prototype and jQuery together</title><description>I thought that prototype and jQuery using together is like impossible.&lt;br /&gt;&lt;br /&gt;As I was using lightbox by prototype but also need the dockmenu by jQuery.&lt;br /&gt;The result: jQuery menu was working well but the prototype lightbox just disabled.&lt;br /&gt;&lt;br /&gt;Didn't find much until this one life saving &lt;a href="http://disjointthoughts.com/2007/08/17/getting-thickbox-jquery-and-prototype-to-play-together-nicely/" target="_blank"&gt;post&lt;/a&gt; by &lt;a href="http://disjointthoughts.com/about/" target="_blank"&gt;Benjamin Smith&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And both the scripts started working well, no errors and headaches.&lt;br /&gt;If want to use jQuery with other library you can read this &lt;a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries"&gt;reference&lt;/a&gt;.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-4057698799355049218?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/BBUdbgVn61o" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/BBUdbgVn61o/using-prototype-and-jquery-together.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/using-prototype-and-jquery-together.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-1463286583399779092</guid><pubDate>Mon, 08 Jun 2009 03:29:00 +0000</pubDate><atom:updated>2009-07-17T03:54:35.115-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>Gruff vertical labels</title><description>As I was working on the project which has pdf reporting functionality, which also contains charts and other related data.&lt;br /&gt;So need to convert those charts to printer friendly images, which was possible through &lt;a href="http://nubyonrails.com/pages/gruff" target="_blank"&gt;gruff graphs for ruby&lt;/a&gt;.&lt;br /&gt;But X-axis labels were so long that those can not stay on one line.&lt;br /&gt;So I tried to make it vertical with help of post by &lt;a href="http://mrtibs.blogspot.com/2008/07/vertical-labels-in-gruff.html" target="_blank"&gt;mrtibs vertical labels in gruff&lt;/a&gt; which really helped.&lt;br /&gt;But problem with that was labels should go at the bottom of the chart and not at the top.&lt;br /&gt;So instead of&lt;div class="code"&gt;&lt;blockquote&gt;y_offset = @graph_bottom + LABEL_MARGIN&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;we used &lt;div class="code"&gt;&lt;blockquote&gt;y_offset = ((@graph_height / 2) + (@graph_top * 3) - 5 )&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;which worked for me a bit but not fully functional.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-1463286583399779092?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/8nxtAsK6oMU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/8nxtAsK6oMU/gruff-vertical-labels.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>2</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/gruff-vertical-labels.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-5052285475038262747</guid><pubDate>Sat, 06 Jun 2009 07:48:00 +0000</pubDate><atom:updated>2009-06-08T05:49:29.423-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><category domain="http://www.blogger.com/atom/ns#">css</category><title>Simple popup with cool effects</title><description>There are many ways of adding popup in the application. But the most simple and beautiful way of adding it will be with the help of prototype, scriptaculous and very little CSS.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.prototypejs.org/" target="_blank"&gt;Prototype.js&lt;/a&gt; is a javascript library written by &lt;a href="http://conio.net/" target="_blank"&gt;Sam Stephenson&lt;/a&gt;. And adding &lt;a href="http://script.aculo.us/" target="_blank"&gt;scriptaculous&lt;/a&gt; with that will help to add amazing cool effects for displaying information more effectively.&lt;br /&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;For example:&lt;br /&gt;&lt;blockquote&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; Simple popup with cool effects &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script src="prototype.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script src="scriptaculous.js?load=effects" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;body{&lt;br /&gt;background:#CFDEE2;&lt;br /&gt;margin:0;&lt;br /&gt;font:11px verdana;}&lt;p&gt;&lt;/p&gt; &lt;o:p&gt;&lt;/o:p&gt;a {&lt;br /&gt; color:#fff;&lt;br /&gt; font-weight:bold;&lt;br /&gt; text-decoration:none}&lt;br /&gt;a:hover{ text-decoration:underline}&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;#title{&lt;br /&gt;background:#CB6D23;&lt;br /&gt; margin:0;&lt;br /&gt; padding:0;&lt;br /&gt; height:40px;&lt;br /&gt; line-height:40px;}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;#close{&lt;br /&gt; background:#CB6D23;&lt;br /&gt; margin:0;&lt;br /&gt; padding:0;&lt;br /&gt; height:30px;&lt;br /&gt; line-height:30px;}&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;#close a{ float:right;}&lt;br /&gt;&lt;br /&gt;#close a:hover{ text-decoration:none}&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;#wrapper{&lt;br /&gt; width:600px;&lt;br /&gt; height:100%;&lt;br /&gt; margin:0 auto;&lt;br /&gt;background:#fff}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;p{width:80%; margin:20px auto}&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;#hiddendiv{&lt;br /&gt; position:absolute;&lt;br /&gt; background: #fff;&lt;br /&gt; top:50%;&lt;br /&gt; left:50%;&lt;br /&gt; margin: -100px 0 0 -200px;&lt;br /&gt; width: 400px;&lt;br /&gt; height: 200px;&lt;br /&gt; border: 4px solid #CB6D23}&lt;br /&gt;&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;div id="wrapper"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div id="title"&amp;gt;    &amp;lt;a href="#" onclick="$('hiddendiv').appear(); return false;"&amp;gt;Show me the popup&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div id="hiddendiv" style="display:none"&amp;gt;&lt;br /&gt;&amp;lt;div id="close"&amp;gt; &amp;lt;a href="#" onclick="$('hiddendiv').fade(); return false;"&amp;gt;[X]&amp;lt;/a&amp;gt; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt; You can also give some other cool effects to this popup. &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt; &amp;lt;p&amp;gt;This is the most easy way of adding the popup with cool effects. &amp;lt;/p&amp;gt; &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Other effects can be found at &lt;a href="http://github.com/madrobby/scriptaculous/tree/master" target="_blank"&gt;scriptaculous combination of effects.&lt;/a&gt;&lt;p&gt;&lt;/p&gt;And can download from &lt;a href="http://script.aculo.us/downloads" target="_blank"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-5052285475038262747?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/9w9yCg1OdaE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/9w9yCg1OdaE/simple-popup-with-cool-effects_06.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/simple-popup-with-cool-effects_06.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7702816563349321195.post-8705308225568186057</guid><pubDate>Fri, 05 Jun 2009 06:13:00 +0000</pubDate><atom:updated>2009-07-30T05:49:45.076-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby on rails</category><title>Sending mail through ruby on rails</title><description>I was working for site and needed something like this for contact form.&lt;br /&gt;&lt;br /&gt;&lt;a rel="nofollow" target="_blank" href="http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-send-emails.htm"&gt;http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-send-emails.htm&lt;/a&gt;&lt;br /&gt;is really nice tutorial for sending mails , can be used for static sites. This helped me a lot.&lt;br /&gt;&lt;br /&gt;But faced some problems,&lt;br /&gt;I didn't get subject and message although the mail was going to the right address.&lt;br /&gt;It was merging with the message and passing through the recipients only .&lt;br /&gt;No other field required for that&lt;br /&gt;&lt;br /&gt;so I made some changes in that&lt;br /&gt;&lt;br /&gt;in (model) ContactMailer.rd&lt;br /&gt;&lt;br /&gt;def contact(recipient, subject, message)&lt;br /&gt;  @subject = "message:: "+subject &lt;br /&gt;  @message = message&lt;br /&gt;  @recipients = '&lt;a rel="nofollow" ymailto="mailto:supriya.s.surve@gmail.com" target="_blank" href="mailto:supriya.s.surve@gmail.com"&gt;your@email.com&lt;/a&gt;' &lt;br /&gt;  @sent_on = Time.now&lt;br /&gt;  @from = recipient&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;and in ContactController.rb&lt;br /&gt;&lt;br /&gt;def sendmail&lt;br /&gt;  email = params[:email]&lt;br /&gt;  subject = email[:subject]&lt;br /&gt;  recipient = email[:recipient]&lt;br /&gt;  message = email[:message]&lt;br /&gt;  ContactMailer.deliver_contact(recipient, subject, message)&lt;br /&gt;  return if request.xhr?&lt;br /&gt;  render :text =&gt; 'Message sent successfully'&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def index&lt;br /&gt;&lt;br /&gt;end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7702816563349321195-8705308225568186057?l=supriya-surve.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SupriyasBlog/~4/gc5TvtRUd7E" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SupriyasBlog/~3/gc5TvtRUd7E/rails-send-emails.html</link><author>noreply@blogger.com (Supriya Surve)</author><thr:total>0</thr:total><feedburner:origLink>http://supriya-surve.blogspot.com/2009/06/rails-send-emails.html</feedburner:origLink></item></channel></rss>

