Posts

Showing posts from 2016

Best site to test Regular Expression.

Click here for   Best site to test Regular Expression.

JavaScript Regex Cheatsheet

Regular Expression Basics . Any character except newline a The character a ab The string ab a|b a or b a* 0 or more a's \ Escapes a special character Regular Expression Quantifiers * 0 or more + 1 or more ? 0 or 1 {2} Exactly 2 {2, 5} Between 2 and 5 {2,} 2 or more Default is greedy. Append ? for reluctant. Regular Expression Groups (...) Capturing group (?:...) Non-capturing group \Y Match the Y'th captured group Regular Expression Character Classes [ab-d] One character of: a, b, c, d [^ab-d] One character except: a, b, c, d [\b] Backspace character \d One digit \D One non-digit \s One whitespace \S One non-whitespace \w One word character \W One non-word character Regular Expression Assertions ^ Start of string $ End of string \b Word boundary \B Non-word boundary (?=...) Positive lookahead (?!...) Negative lookahead Regular Expression Flags g Global Match i Ignore case m ^ and $ match start and end of line Regular Expres

How to track field value changes on form using JQuery?

Below code can track all input fields on form like text, password, check box, select option etc. $('form :input').change(function(){ console.log("Field changed."); });

Eclipse Initializing Java Tooling Error

Image
Following below steps can solve this issue, Step 1: Goto Menu File -> Export It will open a Window, Step 2: Select General -> Preferences Step 3: Click Next Step 4: Now check EXPORT ALL option and Select path where u want to store the preferences and click FINISH . Step 5: Exit Eclipse Step 6: Create a new workspace and then open Eclipse with this new workspace. Step 7: Now again Goto Menu -> File -> Import Step 8: Now select file exported in Step 4 Step 9: Now your Workspace is ready with your preferences, you just need to import your projects in this workspace and Now you will never face this issue of Initializing Java Tooling .

How to disable default success message in portlet?

Just have to add below lines in portlet.xml file inside <portlet>....</portlet> tag. <init-param> <name>add-process-action-success-action</name> <value>false</value> </init-param>

Liferay interview questions...

Liferay Questions:- Role of structure and template ? Can we create the template without structure? What is LDAP configuration in liferay ? What is LDAP configuration in liferay ? Where do you config the database settings ? Explain class scheduler in Liferay ? mail functionality ? service builder ? which classes  are generated after build the services ? local serviceIMPL class in liferay wt is purpose of  that ? what is assest publisher ? what is difference b/w liferay generic portlet and MVC portlet ? what is lifeay schdular ? what is liferay instance ? from action to render how to pass the parameter ? which method do we use from action to rendor? what is serveResource method() ? If u have 3 differen public pages  like welcome1,welcome2,weclome3 by default login portlet is there with out adding login portlet to every page each and every page of my community login page should be there. Java Basic Questions:- main concepts of oops what is encapsulation

Domain mapping for apache-tomcat-7.0.54 using virtual host

1) Add below host to your server.xml file     for me it was on  /usr/local/apache-tomcat-7.0.54/conf/server.xml   path you might find it on location to which you have install your  apache-tomcat-7.0.54 prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />  2) Add your Domain name in  host name  field      2.1  appBase  is the path from were this host (a virtual server) is going to look for  .war  files      2.2 To have your application accessible by hitting @root of the domain  yourdomain.com  keep your war file name as " ROOT.war "  3) So when you start your server this will create a folder with your domain name  yourdomain.com  in below path   /usr/local/apache-tomcat-7.0.54/conf/Catalina/yourdomain.com inside which you will find a ROOT folder which has your application 

No mapping found for HTTP request with URI /j_spring_security_check in DispatcherServlet.

Need to use code like this, <form-login login-page = "/login" default-target-url = "/welcome" login-processing-url = "/j_spring_security_check" authentication-failure-url = "/login?error" username-parameter = "username" password-parameter = "password" />

Push a new local branch to a remote Git repository and track it too

1. To create a new local branch use following command, $ git checkout -b feature_branch_name 2. Make changes to files you want and add+commit them, then fire following command to push local branch to repository, $ git push -u origin feature_branch_name

Git merge options for merging conflicted changes. (Our or Theirs)

We can  tell Git to favor one side or the other when it sees a conflict. By default, when Git sees a conflict between two branches being merged, it will add merge conflict markers into your code and mark the file as conflicted and let you resolve it. If you would prefer for Git to simply choose a specific side and ignore the other side instead of letting you manually resolve the conflict, you can pass the   merge   command either a   -Xours   or   -Xtheirs . If Git sees this, it will not add conflict markers. Any differences that are mergeable, it will merge. Any differences that conflict, it will simply choose the side you specify in whole, including binary files. $ git merge mundo Auto-merging hello.rb CONFLICT (content): Merge conflict in hello.rb Resolved 'hello.rb' using previous resolution. Automatic merge failed; fix conflicts and then commit the result. However if we run it with   -Xours   or   -Xtheirs   it does not. $ git merge -Xours mundo Auto-mergi