Page 11 of 20 FirstFirst ... 910111213 ... LastLast
Results 201 to 220 of 395
  1. #201
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  2. #202
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    You mean still this is not working. I don't know what you have done. But everything is working fine.

    Can you attach your log file here to see.
    yes here i attach the log file..
    Attached Files Attached Files

  3. #203
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  4. #204
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Yes pal, it's working perfectly for me.
    Sir i run your code.what's your out put sir.If you are click again and again on Record button then what you are gating.are you gating only one time out put or many time same out put.
    See what i am geting

    1) Click on record button then i am geting 192.168.6.1 and 192.168.6.2
    2) Click on record button then i am geting 192.168.6.1 and 192.168.6.2
    3)Click on record button then i am geting 192.168.6.1 and 192.168.6.2

    These are showing like this

    192.168.6.2
    192.168.6.1
    192.168.6.2
    192.168.6.1
    192.168.6.2
    192.168.6.1

    And I want to show

    1) Click on record button then i am geting 192.168.6.1 and 192.168.6.2
    2) Click on record button then i am geting 192.168.6.1 and 192.168.6.2
    3)Click on record button then i am geting 192.168.6.1 and 192.168.6.2

    And showing like this
    192.168.6.2
    192.168.6.1

    this is my problem

  5. #205
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    You asking same thing again and again pal.

    Yesterday I ask to add a line text.setText(""); Did you do it.

    Send the public boolean action (Event evt, Object arg) method of the LogFileDlg.java class.

  6. #206
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Yes pal, it's working perfectly for me.
    Quote Originally Posted by Eranga View Post
    You asking same thing again and again pal.

    Yesterday I ask to add a line text.setText(""); Did you do it.

    Send the public boolean action (Event evt, Object arg) method of the LogFileDlg.java class.
    Sorry sir

    i am wrong..You are 100% right it is working. i was put test.setText("") in wrong position.Now it is working..

    Again Sorry..

  7. #207
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Sorry sir...


    Sir may i count how many time a single Ip open.

    i mean is 192.168.6.1 has open 10site it means my log file have redord of 10time of 192.168.6.1. ANd some other ip 192.168.6.2 has open 20site.All redords is record in my log file.

    Now can i count how many time open a single Ip (192.168.6.1).

  8. #208
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    What happen sir?

  9. #209
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Sir are you angry with me..

  10. #210
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Maintain a counter in each search before add to the array list.

    Best place is the LogRecords class.

  11. #211
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Maintain a counter in each search before add to the array list.

    Best place is the LogRecords class.
    i am useing here
    Java Code:
    private void startWork() {
    int counter=0;
    
    
    
    
    counter++;
    Or some where else..

    Plz help me

  12. #212
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    All the time try to do in separately.

    I give a hint. When you found an entry(doesn't matter a duplicate or not) add all of them in another array list. Try to count there each duplicates.

  13. #213
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Sir can you give me code..

  14. #214
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Hello Sir...

  15. #215
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Why don't you try it. Google may have the solution. I've show the way to move. I'll try it later, not now.

  16. #216
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    ok sir i am waiting for your ans.Next day i will ask to you..

  17. #217
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Ok Sir i am fiend Example of this.When i impliment then i am geting error.So here i post the example plz impliment it

    Java Code:
    import java.io.*;
    
    public class OccurancesInArray{
    	public static void main(String[] args) throws IOException{
    		
    		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    		System.out.print("How many elements you want to enter in the array: ");
    		int num=0;
    		try{
    			num = Integer.parseInt(in.readLine());
    		}
    		catch(NumberFormatException ne){
    			System.out.println(ne.getMessage() + " is not a number!");
    			System.exit(0);
    		}
    		String[] elements = new String[num];
    		int a;
    		int k;
    		for(int i = 0; i < num; i++){
    			elements[i] = in.readLine();
    		}
    		for(int i = 0; i < elements.length; i++){
    			a = 0;
    			k = 1;
    			for(int j = 0; j < elements.length; j++){
    				if(j >= i){
    					if(elements[i].equals(elements[j]) && j != i){
    						k++;
    					}
    				}
    				else if(elements[i].equals(elements[j])){
    					a = 1;
    				}
    			}
    			if(a != 1){
    				System.out.println("Occurance of \'" + elements[i] + "\' : " + k);
    			}
    		}
    	}
    }
    Plz help me

  18. #218
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Oh, why did you use such a long way to do it. Actual situation is far more beyond than this. You just want to read a file to do all those things, that is what you have work on right now.

    Think on that place.

  19. #219
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    ok as you told me i have store in array. Plz give me code at last time

  20. #220
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Not in an array... Think that. your log file doesn't contain fix number of entries. So how would you define the size of the array.

    Try to do something. I never give a help like this to anyone else here in the forum. I'll give a code, not now. Try something pal. :)

Page 11 of 20 FirstFirst ... 910111213 ... LastLast

Similar Threads

  1. Must Read.....
    By sanjeevtarar in forum Forum Lobby
    Replies: 10
    Last Post: 03-03-2010, 07:16 PM
  2. how to read a form with JFS
    By crispy in forum JavaServer Faces (JSF)
    Replies: 2
    Last Post: 05-01-2008, 03:07 PM
  3. Read file
    By tajinvillage in forum Threads and Synchronization
    Replies: 0
    Last Post: 01-29-2008, 09:10 AM
  4. How to read the following
    By rrp in forum New To Java
    Replies: 0
    Last Post: 12-03-2007, 06:16 PM
  5. read txt file
    By sureshsri1981 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 08-05-2007, 03:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •