Search Results

Search found 14 results on 1 pages for 'madhan ayyasamy'.

Page 1/1 | 1 

  • Useful SVN and Git commands – Cheatsheet

    - by Madhan ayyasamy
    The following snippets will helpful one who user version control systems like Git and SVN.svn checkout/co checkout-url – used to pull an SVN tree from the server.svn update/up – Used to update the local copy with the changes made in the repository.svn commit/ci – m “message” filename – Used to commit the changes in a file to repository with a message.svn diff filename – shows up the differences between your current file and what’s there now in the repository.svn revert filename – To overwrite local file with the one in the repository.svn add filename – For adding a file into repository, you should commit your changes then only it will reflect in repository.svn delete filename – For deleting a file from repository, you should commit your changes then only it will reflect in repository.svn move source destination – moves a file from one directory to another or renames a file. It will effect your local copy immediately as well as on the repository after committing.git config – Sets configuration values for your user name, email, file formats and more.git init – Initializes a git repository – creates the initial ‘.git’ directory in a new or in an existing project.git clone – Makes a Git repository copy from a remote source. Also adds the original location as a remote so you can fetch from it again and push to it if you have permissions.git add – Adds files changes in your working directory to your index.git rm – Removes files from your index and your working directory so they will not be tracked.git commit – Takes all of the changes written in the index, creates a new commit object pointing to it and sets the branch to point to that new commit.git status – Shows you the status of files in the index versus the working directory.git branch – Lists existing branches, including remote branches if ‘-a’ is provided. Creates a new branch if a branch name is provided.git checkout – Checks out a different branch – switches branches by updating the index, working tree, and HEAD to reflect the chosen branch.git merge – Merges one or more branches into your current branch and automatically creates a new commit if there are no conflicts.git reset – Resets your index and working directory to the state of your last commit.git tag – Tags a specific commit with a simple, human readable handle that never moves.git pull – Fetches the files from the remote repository and merges it with your local one.git push – Pushes all the modified local objects to the remote repository and advances its branches.git remote – Shows all the remote versions of your repository.git log – Shows a listing of commits on a branch including the corresponding details.git show – Shows information about a git object.git diff – Generates patch files or statistics of differences between paths or files in your git repository, or your index or your working directory.gitk – Graphical Tcl/Tk based interface to a local Git repository.

    Read the article

  • Ruby on Rails free books

    - by Madhan ayyasamy
    The following links has ruby on rails tutorials, you can download directly from there website, its fully free of cost..:)Beginning Ruby: From Novice to Professional Building Dynamic Web 2.0 Websites with Ruby on RailsRuby on Rails For DummiesAgile Web Development with RailsThe Ruby Way: Solutions and Techniques in Ruby ProgrammingBeginning Ruby on RailsRails RecipesRails CookbookAjax on RailsThe Art of Rails Programmer to Programmer

    Read the article

  • Hiding the Flash Message After a Time Delay

    - by Madhan ayyasamy
    Hi Friends,The flash hash is a great way to provide feedback to your users.Here is a quick tip for hiding the flash message after a period of time if you don’t want to leave it lingering around.First, add this line to the head of your layout to ensure the prototype and script.aculo.us javascript libraries are loaded:Next, add the following to either your layout (recommended), your view templates or a partial depending on your needs. I usually add this to a partial and include the partial in my layouts. "flash", :id = flash_type % "text/javascript" do % setTimeout("new Effect.Fade('');", 10000); This will wrap the flash message in a div with class=‘flash’ and id=‘error’, ‘notice’ or ‘warn’ depending on the flash key specified.The value ‘10000’ is the time in milliseconds before the flash will disappear. In this case, 10 seconds.This function looks pretty good and little javascript stunts like this can help make your site feel more professional. It’s also worth bearing in mind though, not everybody can see well or read as quickly as others so this may not be suitable for every application.Update:As Mitchell has pointed out (see comments below), it may be better to set the flash_type as the div class rather than it’s id. If there is the possibility that you’ll be showing more than one flash message per page, setting the flash_type as the div id will result in your HTML/XHTML code becoming invalid because the unique intentifier will be used more than once per page.Here is a slightly more complex version of the method shown above that will hide all divs with class ‘flash’ after a time delay, achieving the same effect and also ensuring your code stays valid with more than one flash message! "flash #{flash_type}" % "text/javascript" do % setTimeout("$$('div.flash').each(function(flash){ flash.hide();})", 10000); In this example, the div id is not set at all. Instead, each flash div will have class “div” and also class of the type of flash message (“error”, “warning” etc.).Have a Great Day..:)

    Read the article

  • Date Time Format in RUBY

    - by Madhan ayyasamy
    The following snippets is very useful when we render views dates in various format in ruby on rails."Format meaning:  %a - The abbreviated weekday name (``Sun'')  %A - The  full  weekday  name (``Sunday'')  %b - The abbreviated month name (``Jan'')  %B - The  full  month  name (``January'')  %c - The preferred local date and time representation  %d - Day of the month (01..31)  %H - Hour of the day, 24-hour clock (00..23)  %I - Hour of the day, 12-hour clock (01..12)  %j - Day of the year (001..366)  %m - Month of the year (01..12)  %M - Minute of the hour (00..59)  %p - Meridian indicator (``AM''  or  ``PM'')  %S - Second of the minute (00..60)  %U - Week  number  of the current year,          starting with the first Sunday as the first          day of the first week (00..53)  %W - Week  number  of the current year,          starting with the first Monday as the first          day of the first week (00..53)  %w - Day of the week (Sunday is 0, 0..6)  %x - Preferred representation for the date alone, no time  %X - Preferred representation for the time alone, no date  %y - Year without a century (00..99)  %Y - Year with century  %Z - Time zone name  %% - Literal ``%'' character   t = Time.now   t.strftime("Printed on %m/%d/%Y")   #=> "Printed on 04/09/2003"   t.strftime("at %I:%M%p")            #=> "at 08:56AM""Have a great day!

    Read the article

  • Rails Easy Data Dumping

    - by Madhan ayyasamy
    Hi Friends,The following useful snippets,you can find out the easiest way of ruby on rails environment data dumping. You’ll often need to get data from production to dev or dev to your local or your local to another developer’s local. One plug-in we use over and over is Yaml_db. This nifty little plug-in enables you to dump or load data by issuing a Rake command. The data is persisted in a yaml file located in db/data.yml. This is very portable and easy to read if you need to examine the data.01rake db:data:dump02 03example data found in db/data.yml04 05---06campaigns:07  columns:08  - id09  - client_id10  - name11  - created_at12  - updated_at13  - token14  records:15  - - "1"16    - "1"17    - First push18    - 2008-11-03 18:23:5319    - 2008-11-03 18:23:5320    - 3f2523f6a66521  - - "2"22    - "2"23    - First push24    - 2008-11-03 18:26:5725    - 2008-11-03 18:26:5726    - 9ee8bc427d94

    Read the article

  • Difference between IN and FIND_IN_SET

    - by Madhan ayyasamy
    Hi Friends,You may be confused with IN() and FIND_IN_SET() MYSQL functions. There are specific case/situation for both functions where to use which Mysql function. Look at below explanation about IN() and FIND_IN_SET()IN() : This function is used when you have a list of possible values and a single value in your database.Example: WHERE memberid IN (1,2,3)FIND_IN_SET() : This function is used where you have comma separated list of values stored in database and want to see if a certain value exists in that comma seperated list.Example: WHERE FIND_IN_SET( ‘table column name like id’, 'dynamic idlist' )

    Read the article

  • How to Inspect Javascript Object

    - by Madhan ayyasamy
    You can inspect any JavaScript objects and list them as indented, ordered by levels.It shows you type and property name. If an object property can't be accessed, an error message will be shown.Here the snippets for inspect javascript object.function inspect(obj, maxLevels, level){  var str = '', type, msg;    // Start Input Validations    // Don't touch, we start iterating at level zero    if(level == null)  level = 0;    // At least you want to show the first level    if(maxLevels == null) maxLevels = 1;    if(maxLevels < 1)             return '<font color="red">Error: Levels number must be > 0</font>';    // We start with a non null object    if(obj == null)    return '<font color="red">Error: Object <b>NULL</b></font>';    // End Input Validations    // Each Iteration must be indented    str += '<ul>';    // Start iterations for all objects in obj    for(property in obj)    {      try      {          // Show "property" and "type property"          type =  typeof(obj[property]);          str += '<li>(' + type + ') ' + property +                  ( (obj[property]==null)?(': <b>null</b>'):('')) + '</li>';          // We keep iterating if this property is an Object, non null          // and we are inside the required number of levels          if((type == 'object') && (obj[property] != null) && (level+1 < maxLevels))          str += inspect(obj[property], maxLevels, level+1);      }      catch(err)      {        // Is there some properties in obj we can't access? Print it red.        if(typeof(err) == 'string') msg = err;        else if(err.message)        msg = err.message;        else if(err.description)    msg = err.description;        else                        msg = 'Unknown';        str += '<li><font color="red">(Error) ' + property + ': ' + msg +'</font></li>';      }    }      // Close indent      str += '</ul>';    return str;}Method Call:function inspect(obj [, maxLevels [, level]]) Input Vars * obj: Object to inspect * maxLevels: Optional. Number of levels you will inspect inside the object. Default MaxLevels=1 * level: RESERVED for internal use of the functionReturn ValueHTML formatted string containing all values of inspected object obj.

    Read the article

  • Useful links

    - by Madhan ayyasamy
    Difference between STI vs Polymorphic associationsSTI vs PolymorphicDifference between habtm vs has_many :throughhabtm vs throughCapistrano Guide linkCapistrano guideRails application without database stuffclass Car < ActiveRecord::Baseself.abstract = trueendAnother link: rails without databaseNamed scope useful linkNamed scopeDifference between http and https verbhttp vs httpsRails 2.3 useful guide websiterails 2.3 guide

    Read the article

  • Custom field names in Rails error messages

    - by Madhan ayyasamy
    The defaults in Rails with ActiveRecord is beautiful when you are just getting started and are created everything for the first time. But once you get into it and your database schema becomes a little more solidified, the things that would have been easy to do by relying on the conventions of Rails require a little bit more work.In my case, I had a form where there was a database column named “num_guests”, representing the number of guests. When the field fails to pass validation, the error messages is something likeNum guests is not a numberNot quite the text that we want. It would be better if it saidNumber of guests is not a numberAfter doing a little bit of digging, I found the human_attribute_name method. You can override this method in your model class to provide alternative names for fields. To change our error message, I did the followingclass Reservation ... validates_presence_of :num_guests ... HUMAN_ATTRIBUTES = { :num_guests = "Number of guests" } def self.human_attribute_name(attr) HUMAN_ATTRIBUTES[attr.to_sym] || super endendSince Rails 2.2, this method is used to support internationalization (i18n). Looking at it, it reminds me of Java’s Resource Bundles and Spring MVC’s error messages. Messages are defined based off a key and there’s a chain of look ups that get applied to resolve an error’s message.Although, I don’t see myself doing any i18n work in the near-term, it is cool that we have that option now in Rails.

    Read the article

  • SQL Server 2014 CTP1 now available for download as well as in Windows Azure Image Gallery

    - by SQLOS Team
    Exciting news - At TechEd Europe 2013 keynote today, we announced that SQL Server 2014 CTP1 is now available for download as well as in Windows Azure Image Gallery. Try it out now and give us feedback. http://www.microsoft.com/en-us/sqlserver/sql-server-2014.aspx http://europe.msteched.com/#fbid=bdRdsIPwIgn - Watch the Keynote again   thanks, Madhan     Originally posted at http://blogs.msdn.com/b/sqlosteam/

    Read the article

  • Reverse a singly linked list

    - by Madhan
    I would be wondered if there exists some logic to reverse the linked list using only two pointers. The following is used to reverse the single linked list using three pointers namely p, q, r: struct node { int data; struct node *link; }; void reverse() { struct node *p = first, *q = NULL, *r; while (p != NULL) { r = q; q = p; p = p->link; q->link = r; } q = first; } Is there any other alternate to reverse the linked list? what would be the best logic to reverse a singly linked list, in terms of time complexity?

    Read the article

  • How to parse json data from https client in android

    - by Madhan Shanmugam
    I try to fetch data from https client. Same code i used to fetch from http client. but its working fine. when i try to use Https client its not working. i am getting the following error. java.net.UnknownHostException: Host is unresolved: https client address:443 Error Log: 10-27 10:01:08.280: W/System.err(21826): java.net.UnknownHostException: Host is unresolved: https client address.com 443 10-27 10:01:08.290: W/System.err(21826): at java.net.Socket.connect(Socket.java:1037) 10-27 10:01:08.290: W/System.err(21826): at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:317) 10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:129) 10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348) 10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 10-27 10:01:08.320: W/System.err(21826): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 10-27 10:01:08.320: W/System.err(21826): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) 10-27 10:01:08.320: W/System.err(21826): at com.myfile.JSONParser.getJSONFromUrl(JSONParser.java:38) 10-27 10:01:08.320: W/System.err(21826): at com.myfile.myfile.processThread(myfile.java:159) 10-27 10:01:08.330: W/System.err(21826): at com.peripay.PERIPay$1$1.run(myfile.java:65) 10-27 10:01:08.330: E/Buffer Error(21826): Error converting result java.lang.NullPointerException 10-27 10:01:08.330: E/JSON Parser(21826): Error parsing data org.json.JSONException: A JSONObject text must begin with '{' at character 0 of

    Read the article

1