Click here to Skip to main content
15,868,292 members
Home / Discussions / Java
   

Java

 
GeneralRe: can anyone help me with my final project Pin
bakary.konate30-Apr-13 22:14
bakary.konate30-Apr-13 22:14 
Questionexception : javax.naming.NoInitialContextException: Pin
swarjava23-Mar-13 17:41
swarjava23-Mar-13 17:41 
AnswerRe: exception : javax.naming.NoInitialContextException: Pin
Prasad Khandekar26-Apr-13 0:30
professionalPrasad Khandekar26-Apr-13 0:30 
QuestionOnlick POPUP the Calender month based on dropdownlist Pin
siddiqali md21-Mar-13 2:17
siddiqali md21-Mar-13 2:17 
AnswerRe: Onlick POPUP the Calender month based on dropdownlist Pin
Richard MacCutchan21-Mar-13 3:32
mveRichard MacCutchan21-Mar-13 3:32 
QuestionHow to import file and compare the file with other file in j2se platform Pin
Member 824369315-Mar-13 9:47
Member 824369315-Mar-13 9:47 
AnswerRe: How to import file and compare the file with other file in j2se platform Pin
Richard MacCutchan15-Mar-13 23:11
mveRichard MacCutchan15-Mar-13 23:11 
AnswerRe: How to import file and compare the file with other file in j2se platform Pin
Prasad Khandekar26-Apr-13 0:36
professionalPrasad Khandekar26-Apr-13 0:36 
Hello,

Please have a look at Java Diff Utils project. You can compare two files using it. Here is a sample code which prints the differences between the two files, directly taken from the project.
Java
import difflib.*;
 
public class BasicJavaApp_Task1 {
    // Helper method for get the file content
    private static List<String> fileToLines(String filename) {
        List<String> lines = new LinkedList<String>();
        String line = "";

        try {
            BufferedReader in = new BufferedReader(new FileReader(filename));
            while ((line = in.readLine()) != null) {
                lines.add(line);
            }
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        return lines;
    }

    public static void main(String[] args) {
        List<String> original = fileToLines("originalFile.txt");
        List<String> revised  = fileToLines("revisedFile.xt");
                
        // Compute diff. Get the Patch object. Patch is the container for computed deltas.
        Patch patch = DiffUtils.diff(original, revised);

        for (Delta delta: patch.getDeltas()) {
            System.out.println(delta);
        }
    }
}


Regards,
Prasad P. Khandekar
Knowledge exists, man only discovers it.

GeneralGame Development using Android Platform Pin
Celmar Galindez14-Mar-13 3:31
Celmar Galindez14-Mar-13 3:31 
GeneralRe: Game Development using Android Platform Pin
Richard MacCutchan14-Mar-13 4:55
mveRichard MacCutchan14-Mar-13 4:55 
QuestionQueue implementation in java Pin
KishoreT14-Mar-13 2:15
KishoreT14-Mar-13 2:15 
AnswerRe: Queue implementation in java Pin
Richard MacCutchan14-Mar-13 3:02
mveRichard MacCutchan14-Mar-13 3:02 
AnswerRe: Queue implementation in java Pin
Amarnath S4-May-13 5:48
professionalAmarnath S4-May-13 5:48 
QuestionHelps, Rijndael on java swing Pin
code99013-Mar-13 23:20
code99013-Mar-13 23:20 
AnswerRe: Helps, Rijndael on java swing Pin
Nagy Vilmos14-Mar-13 1:07
professionalNagy Vilmos14-Mar-13 1:07 
GeneralRe: Helps, Rijndael on java swing Pin
code99015-Mar-13 0:15
code99015-Mar-13 0:15 
QuestionThread implementation in Eclipse Plug-in Pin
KishoreT13-Mar-13 6:19
KishoreT13-Mar-13 6:19 
QuestionRegarding K-means Text Clustering Pin
sunny funny12-Mar-13 21:43
sunny funny12-Mar-13 21:43 
AnswerCross posted from C# forum Pin
Pete O'Hanlon12-Mar-13 22:05
subeditorPete O'Hanlon12-Mar-13 22:05 
Questionwhat is the difference between sendRedirect() and forward()? Pin
venky002811-Mar-13 19:38
venky002811-Mar-13 19:38 
AnswerRe: what is the difference between sendRedirect() and forward()? Pin
Sandeep Mewara11-Mar-13 20:44
mveSandeep Mewara11-Mar-13 20:44 
AnswerRe: what is the difference between sendRedirect() and forward()? Pin
vkscool24-Mar-13 21:01
vkscool24-Mar-13 21:01 
QuestionHow to use time picker in jsp? Pin
Phyo Thinzar Aung10-Mar-13 23:26
Phyo Thinzar Aung10-Mar-13 23:26 
AnswerRe: How to use time picker in jsp? Pin
Richard MacCutchan10-Mar-13 23:39
mveRichard MacCutchan10-Mar-13 23:39 
AnswerRe: How to use time picker in jsp? Pin
Shubhashish_Mandal14-Mar-13 0:26
professionalShubhashish_Mandal14-Mar-13 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.