Friday, 26 December 2014

Vesio Online for both reading and working Microsoft.

https://www.lucidchart.com/documents/edit/96eed0cd-05b4-4865-a575-0f3707bf9bc0#

Sun Certification Dumps for Java both SCJP and OCPJP

Sun Certified Java Programmer ( SCJP- OCPJP ) Certification DUMPS

Friday, 12 December 2014

How to disable the rules in sonar.

it's very easy to disable and enable the rules in sonar
login to http://localhost:9000/ for sonar server.
your project should be added here.
click here.to seee
now you need to log in..user name is admin.pwd is admin
 1:-go to quality profile
 then selcet java profile
 2:-sonar way
 3:enter the rule as key ..here and click on serach . now uncheck the box and ..inactive it
 and go to dashboard ...and leave it.

 4:-now run sonnar runner command once again..
 and check your dashboard once again you can see. the rule has reflected vice versa you can do .
 just enable it and ..do same rest of process..

Wednesday, 10 December 2014

SonarQube Tool set up manually

you can use sonar in manual process way..

Eclipse plugin approach is available her

http://javadeveloperchoiceno1.blogspot.in/p/sonar.html

Installation Steps:


·         Go to http://www.sonarqube.org/downloads/ link and download latest version of SonarQube and SonarQube Runner. Extract the zip to local directory.
·         Set SONAR_RUNNER_HOME environment variable to SonarQube directory.
Ex: SONAR_RUNNER_HOME =D:\sonar-runner-2.3
·         Set JAVA_HOME Path

·         Set Path=% JAVA_HOME %;% SONAR_RUNNER_HOME %;

Starting SonarQube Server & Running Project Analyzer the project:


·         Open command prompt & go to SonarQube/bin/ directory. In bin directory there are many directories. Go to suitable directory depending on your OS. For example for Windows with 32 bit directory would be SonarQube/bin/ windows-x86-32.
·         Run StartSonar.bat command & wait for few seconds to start the server.
         
       open browser & go to http://localhost:9000/ URL to confirm the SoanarQube server is up & running. 
        
       then
       ·         Click on Login link to login with default user name “admin” & password “admin”.
·         In order to analyze the project, we have to create “sonar-project.properties” file in our java project root directory. Sample “sonar-project.properties” file:

fi     fill these detail inside property file
        # Required metadata
sonar.projectKey=java-sonar-runner-simple
sonar.projectName=ETailWebApp
sonar.projectVersion=1.0

# Comma-separated paths to directories with sources (required)
sonar.sources=src
# Language
sonar.language=java
# Encoding of the source files
sonar.sourceEncoding=UTF-8


·       Open command prompt & go to Java project root directory which we want to analyze (Make sure SonarQube server is started & “sonar-project.properties” file is in project root directory).
Run sonar-runner batch file which is in sonar-runner/bin directory (We have downloaded sonar-runner.zip & sonarqube.zip file & extracted it in local file

open cmd use follwing kind of command
 cd D:\GE GDC Working Folder\ashish.negi\EtailProject\ETailWebApp_4
go up to your project..which has sonnar properties file
 then

use this command
D:\Sonar\sonar-runner-2.3\bin\sonar-runner.bat

now you can see porject been interarated with report
Now go to http://localhost:9000/ to open the Dashboard. Now in project section there will be a project.

after this

Ø  After getting Project into Sonar… Use following URL…
Ø  Save xml file into local… Ex: D:\violations.xml
Ø  Open that xml file from     Excel. ( We will get Excel Report here..)




while doing all this set up you can get some issue please follow following url


 



t







Friday, 21 November 2014

How To Parse XML File In Java,,

We have couple of  ways to do in java or some other ways ..
 I have mentioned (4)ways we. 

1:-Creating a Java DOM XML Parser

:--
2:-Parsing XML with a Java DOM Parser

3:-Creating an XPath object

4:-Using XPath to parse the XML

more you can find in below link:-

--------------------------------------------------------

Monday, 17 November 2014

How to Dectect the request coming to you server from ..PC Browser,Mobile.Tablet

 There is one thing common in all case..so called Agent.Agent has a all the values
 which distinguish b/w PC,mobile and tablet browser.it has diifernet-different values
now what you need to do..fetch the user-agent from the request and after that keep the object name like i kept Agnet in the script ...and based on conditon now you can decide..either mobile.pc or tablet.



String agentCode=request.getHeader("User-Agent").toLowerCase();
                  if(agentCode.matches("(?i).*((android|bb\\d+|meego).+mobile|iPod|iPad|PlayBook|Nexus|iPhone|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino).*")||agentCode.substring(0,4).matches("(?i)1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-"))
                  { System.out.print("mobile");
                    System.out.print("this request coming from mobile");
                    try{
                    response.sendRedirect("http://localhost:7001/mapply/eapply.action?uniqueId="+uniqueId);
                       
                    }catch(Exception e){}
                      return Action.NONE;
                  }


// you can get more reliable link
http://detectmobilebrowsers.com/
https://code.google.com/p/mobileesp/source/browse/Java/UAgentInfo.java

Wednesday, 12 November 2014

How to use log4j.framework in java Application(project)


package com.logfor.common.notification;
public class Notification{

   public static final Logger logger = Logger.getLogger(Notification.class);
    public void notify(VO VO) throws ApplicationException {
     
        if(ConfigFile.getConfigProperty(Constants.LOG_SEVERITYS).contains(VO.getLogLevel())) {
           logMessage(VO);
        }
        if(ConfigFile.getConfigProperty(Constants.EMAIL_SEVERITYS).contains(VO.getLogLevel())) {
           //Call Email Notification
           if(Constants.DB.equals(VO.getGroupName())) {
               VO.setToList(ConfigFile.getConfigProperty(Constants.DB_GROUP));
               VO.setMailSubject(ConfigFile.getConfigProperty(Constants.MAIL_SUBJECT));
           }
           Email.send(VO);//for sending the message
           logger.info("Email Notification");
       }
       if(ConfigFile.getConfigProperty(Constants.EXCEPTION_SEVERITYS).contains(VO.getLogLevel())) {
           //Call Email Notification
          // logMessage(VO);
          logger.info("Exception Notification");
           if(StringUtils.isBlank(VO.getDisplayMessage())){
               throw new ApplicationException(ConfigFile.getConfigProperty(Constants.DISPLAY_MESSAGE));
           }else{
                throw new ApplicationException(VO.getDisplayMessage());
            }//else
         
       }
 
   }
    public  void logMessage(VO VO) {
        String logMessage="";
        StringBuilder sb=new StringBuilder();
        sb.append(VO.getLogLevel()+"~");
        sb.append(VO.getClassName().getClass().getName());  
        logMessage=sb.toString();
        if(Constants.INFO.equals(VO.getLogLevel()))
          logger.info(logMessage);
        else if(Constants.WARN.equals(VO.getLogLevel()))
          logger.warn(logMessage);
        else if(Constants.ERROR.equals(VO.getLogLevel()))
          logger.error(logMessage);
        else if(Constants.FATAL.equals(VO.getLogLevel()))
          logger.fatal(logMessage);
        else if(Constants.DEBUG.equals(VO.getLogLevel()))
         logger.debug(logMessage);
    }
 
}
-----------------------------------------------------
now we need a VO which has all value need to show in logging for .log

package com.ashish.eapply.vo;
public class VO extends BaseVTO{
    
    private String logLevel;
    private Object className;
    private String methodName;   
    /**
     * @param logLevel
     * @param message
     * @param className
     * @param methodName
     */
    public VO(String logLevel, String message, Object className, String methodName)
    {
        super();
        this.logLevel = logLevel;
        this.message = message;
        this.className = className;
        this.methodName = methodName;
    }
    public VO(String logLevel, String logMessage, String displayMessage, Object className, String methodName)
    {
        super();
        this.logLevel = logLevel;
        this.message = logMessage;
        this.displayMessage = displayMessage;
        this.className = className;
        this.methodName = methodName;
    } 
    public VO(String logLevel, String message, Object className, String methodName,String groupName)
    {
        super();
        this.logLevel = logLevel;
        this.message = message;
        this.className = className;
        this.methodName = methodName;
        this.groupName = groupName;
    }

    public VO() {
        super();
    }
create getter settere..
---------------------------------------------------------------------------
 now keep this kind of code in your application .anywhere ...all the best

       try {
                     notification.notify(new NotifyVO(Constants.INFO,
                                                  "in valide  Number :"+no,
                                                  this,Thread.currentThread().getStackTrace()[1].getMethodName() +
                                                  NotificationConstants.LINE +Thread.currentThread().getStackTrace()[1].getLineNumber()));
                 } catch (ApplicationException e) {
                 }
 
        try {
                // logic based on logic
            } catch (Exception e) {
                notification.notify(new VO(Constants.INFO," Exception ", this,Thread.currentThread().getStackTrace()[1].getMethodName() +
                                                  NotificationConstants.LINE +Thread.currentThread().getStackTrace()[1].getLineNumber()));   
            }


FREE JAVA TUTORIAL


You will see java training vedio.If we have learning curiosity then there is lot for you.you can learn here java training vedio,

below are some of the main content, and it's updated time to time so keep look on,
please visit to "http://javabrains.koushik.org" website. You will find the excellent video tutorials by Koushik.
1. Spring Framework.
2. Struts 2.
3. Hibernate.
4. Maven.
5. JSP's and Servlets.

Please do visit "Java Brains" once.
http://javabrains.koushik.org

We have java tutorial for reading purpose
http://www.mkyong.com/
http://www.tutorialspoint.com/java/
http://www.javatpoint.com/
but these better you can google it. based on you requirment.

Tuesday, 11 November 2014

Free Online Facility For Java


Frinds there is no bond of learning
you might face some setting in your system
for java environment issue

now no need to worry you can use online tool effectively
you can run ,write your program even decompile


we have online java environment
http://www.compileonline.com/try_javascript_online.php

we have tool for java Decompiler you can convert your code .class to java
http://www.showmycode.com/

We have online tools for Unix..
http://www.masswerk.at/jsuix/
http://cb.vu/

Java File Encryption Decryption using Password Based Encryption.


How PBE Works (Password Based Encryption)

  • A user supplied password which is a simple text phrase that can be easily remembered by the user.
  • Along with that password text, a random number which is called salt is added and hashed.
  • Using this a AES or a DES encryption key is derived and encrypted.
  • The password text is shared between the two parties exchanging the encrypted content.
  • The receiver, uses the same password  and salt and decrypts the content.
  • Here the key is passing or preserving the password phrase in a secure manner.

Saturday, 8 November 2014

Jdeveloper Maven Plugin:-


Let me correct you certain fact
1-jdeveloper 11.1.6 you don't get maven plugin .even manually jar setting.jdeveloper community not providing
2-jdeveloper 11.2. Onwards you Will get plugin facility and it's easy to work ..the procedure given below.\

Working With Maven Projects In Oracle JDeveloper 11g

An Oracle JDeveloper How To Document
Written by Dana Singleterry, Oracle Corporation 
Created June 2011
please check above link.

Wednesday, 5 November 2014

How to Find the Browser information Agent,Cookies,and lot more

Sometimes we want to know about browser information,for some purpose and based on it we want to do some process, for that we must know browser info..like agent, what parameter are coming along with request and so..

We can do by create one web application.
create servlet:--
-----
@WebServlet("/AgentServlet")
public class AgentServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
     
    /**
     * @see HttpServlet#HttpServlet()
     */
    public AgentServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub

Map<String, String> map = new HashMap<String, String>();

Enumeration headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
String key = (String) headerNames.nextElement();
String value = request.getHeader(key);
map.put(key, value);
}

System.out.println(map);
PrintWriter pw =response.getWriter();
pw.write(map.toString());

 pw.write("\n spcific to user-agent");

 pw.write(request.getHeader("user-agent"));
}
/**
-----------------------------------
create a jspP--

<form action="AgentServlet" method="get">
<table>
<tr><td>ready to see</td></tr>
<tr><td colspan="2"><input id="submit" type="submit"/>
</td></tr>
</table>
</form>
-------------------------
now you can see the info.. 

Friday, 24 October 2014

10 Online Coding Contests For Programmers!

Be Unique:--

If you think you have the best coding skills in the town or if you are a starter and you are willing to practice your coding and compete against the very best of coding, then you are reading the right article! Here we bring to you 10 online programming contests, where coders from all around the world compete.
programming, Programming languanges, coding, programming competion, programming contests, coding contests, coding competitions, developers, coders, Job for developers,

These sites have their sets of practice problems, practice sessions and competition rounds. Major of the competitions are sponsored by some big shot companies and they also keep a keen eye on the contests, so who knows you might just one lucky person to be selected for a big internship or for a big job. Some of these competitions are held on weekly, monthly or yearly basis where as others have specific dates for competitions. 

GoogleCode Jam:-
That's a wrap. The eleventh annual Code Jam Finals wrapped up in Los Angeles, CA ..

Topcoder

TopCoder is indeed the world’s largest competitive software development community where developers from all over the world take part in. The community offers timed programming competitions in various categories like algorithms, testing, design, assembly, SRM, marathon and many others. The competition is sponsored by big names like Microsoft and the NSA and they offer cash prizes for the winners. Solutions can be submitted in Java, C++, C#, or VB.

CodeChef

CodeChef is a non-commercial organization operated by DirectI, an Indian software company based in Mumbai, India. It is a global programming community which hosts online contests, trainings and events for programmers from around the world.

Sphere online judge (SPOJ)

Sphere online judge is one of the earliest competitions, with support for more than 40 programming languages and compilers. The SPOJ platform has been created around an online judge system, which serves for the automatic assessment of user-submitted programs.

CodingBat

CodingBat is a live coding site, which offers problems to build coding skills in Java and Python. The problems here provide instant feedback which also works as a brilliant platform for the coders to practice and grasp the basics of programming.

Google Code Jam

Google Code Jam is an annual programming competition sponsored and supported by Google itself. Here, professional and student programmers provided complex algorithmic challenges to solve using the programming language of their choice in a limited amount of time.

Dream in Code

Dream In Code (DIC) is a online community for programmers and web developers. Members have free access to thousands of programming tutorials, code snippets, forum topics and more.

Codeforces

Codeforces is an online programming platform where you can practice variety of problems and submit competitive ones and compete on problems submitted by other users.

UVa Online Judge

This online coding site is maintained by University of Valladolid, Spain. Here you can find problems from past programming contests such as the ACM International Programming Contest and also one can submit their own source codes in a variety of languages.

Python Challenge

Focused on the Python programming language, Python Challenge is a series of programming challenges. Although any language could be used to solve the puzzles, many of the clues are easier to decipher if you’re working in Python.

Facebook Puzzles

As the name suggests this small set of programming problems is conducted by Facebook to evaluate potential hires. One can submit their solutions in a variety of languages like C++, C, Haskell, Java, Perl, PHP, Python, or Ruby.

ACM-ICPC

ACM – ICPC is one of the world’s largest programming contest conducted annually. The contest is basically sponsored by IBM for teams of students. The contests majorly involves algorithmic programming problems. Regional contests lead to World level Finals. Supports only two languages i.e. C/C++ and Java.

Wednesday, 22 October 2014

Best Java Developer's Blogs


This list collects 100 high quality blogs from Java developers from all over the world. Some of these blogs may not be written by Java developers, but at least Java developers should find it useful or interesting. Reading those blogs should be fun and often bring some fresh ideas.
Google ranks large websites higher. That is not so fair for small high-quality blogs. There are a lot of sites that have very large traffic, but they may not have high quality. My definition of high quality is as follows
Name(Site/People)CountryKey Words
1Adam BienGermanyJava EE
2Antonio GoncalvesFranceAuthor of Java EE 7
3Henrik WarneSwedenThoughts on programming
4Billy YaroshAmericaCoding Cures
5Lars VogelGermanyAndroid and Eclipse
6Peter VerhasHungaryPure Java
7Martin FowlerAmericaAuthor, Speaker
8Bozhidar BozhanovBulgariaJEE
9Richard WarburtonUKJava 8 Lambdas
10Bear GilesAmericaJEE
11Marginally InterestingGermanyMachine Learning
12Pascal AlmaAmericaJEE
13Dror HelperAmericaConsultant
14Juri StrumpflohnerItalyJavaScript
15Reza RahmanAmericaJava EE/Glassfish
16Phil WhelanCanadaWeb
17Brett PorterAustraliaCo-author of Apache Maven 2
18Ben McCannAmericaCo-founder at Connectifier
19Java PosseAmericaSome useful links
20Mark NeedhamUKData
21Iris ShoorIsraelDebug
22Yifan PengAmericaGraduate Student
23Nikita Salnikov TarnovskiEstoniaMemory Leaks
24Dustin MarxAmericaActual Events
25Bart BakkerNetherlandAgile
26Gunnar PeipmanAmericanon-java
27Dave FecakAmericaJob Tips for Programmers
28JOOQSwitzerlandSQL
29Petri KainulainenFinlandWeb
30Informatech CRCosta Rica
31Arun GuptaAmericaJava EE
32Mechanical SympathyUKPerformance
33Extreme EnthusiasmItalyAgile
34Steve BlankAmericaAuthor of The Startup Owner's Manual
35Oliver GierkeGermanySpringSource
36Nicolas FränkelSwitzerlandJava EE
37Blaise DoughanAmericaXML and JSON
38Vlad MihalceaRomaniaSoftware Integration
39Kevin LeeAustraliaWeb
40Mikhail VorontsovAustraliaPerformance
41Jakob JenkovDenmarkSoftware Architecture
42Jim WeaverRich Client Java
43Jonathan GilesNew ZealandJava FX
44Stephen ChinAmericaJava FX
45Matt RaibleAmericaOpen Source Frameworks
46Peter LawreyUKCore Java
47Gregor RieglerAustriaOO Design, XP
48Jos DirksenNetherlandsSOA, HTML 5
49Alexander J. TurnerUKInformation, News And Views
50Java Advent
51John PurcellHungaryTutorials
52Transylvania JUGUK
53Java RootsSpring
54Java TrainingGreecetraining
55Allan KellyUKSoftware
56Samuel SantosPortugalJava EE
57Steve SmithUKAgile
58Niklas SchlimmGermanyMultithreading
59Shrutarshi BasuAmericaPhD, Computer Science
60Anton ArhipovEstoniaJava EE
61Charles NutterAmericaJVM
62RedStackAmericaSOA, JVM
63James BloomAmericaJVM
64Pierre-Hugues CharbonneauCanadaJava EE
65Eugen ParaschivRomaniaJava Web
66Wayne BeatonAmericaEclipse
67Jeff AtwoodAmericaStack Overflow
Program CreekAmericaDeep Understanding of Java Core-------------