Semantic comparision between two word (urgent help)

Dear friends,
Is there any one knows sematic comparision between two keyword? could you please inform me any source code or link which can help me . I am developing sematic classifer . In need to compare two kewyord and get parent- child relationship ??
please send me if you have any souce code or any existing code to my mail or this forume .
thanks!
/ Nicks
here is my e-mail: [email protected]

But you're the one developing the semantic classifier!
I really doubt you'll find some code to generically determine the parent-child relationship between two words because, as you say, this is semantics and derived from context not from content. Google might help you out though:
http://www.google.com/search?hl=en&q=Semantic+Classifier+Java
Good Luck
Lee

Similar Messages

  • Difference/Comparision between two tests

    Hi every one,
    I am trying to write a script for comparing any two tests.
    I got an example script in help, speed_comparision.vbs, Which is very help ful for my script. 
    But I have all files in .dat form. i am converting it to .tdm each time by follwing steps manually,
    1. Load test 1
    2. Load test 2
    3. Keep only time channel and acc in test 1 and acc in test 2. (Delete rest all channels.)
    4. Now save this as speed.tdm or acceleration.tdm.
    Instead of doing this each time for all the .dat files, how can i make it automatic in script. Is it possible. 
    or
    Is there a way to find the difference / comparision between two tests with out converting them to tdm.
    I understand that load 2 tests and come to analysis and integrate the two two tests, I wil get the difference. But I am trying to plot my output in speed_comparision.tdr, which is in help. Plz help me in this regard.
    I need a script for doing this. 
    Thanks ,
    Rash
    Attachments:
    Dat files.zip ‏226 KB

    Hi Shilpa,
    The simplest way is to check the latest requests that has been released and imported in all the concerned servers. to do this u need to go to the table E071, give the Object type as FORM and Object Name as the <name of the Smartform> and execute.
    If u see the top most row of your results contain the same Request No. then u can conclude that there are no differences in the smartform in both the servers.
    Otherwise u can also check the requests displayed after executing the table entries in Tcode SE10 and check whether they have been released or not.
    Hope this helps,
    Arnab.

  • Substring between two words from a clob

    How to extract a string between two words from a clob variable in PL/SQL?

    My requirement is to extract the soap envelope from a clob. In the below code l_response returned from the http request is a clob with the below format. I need to extract all the text that is between '<s:Envelope' and 's:Envelope>'. That means I need to get rid of the first 5 lines and the last line from the l_response. Can you please help me with the logic?
    --uuid:18cb22a2-11cc-43f4-bfea-c213da179d30+id=157
    Content-ID: <http://tempuri.org/0>
    Content-Transfer-Encoding: 8bit
    Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"
    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://tempuri.org/IUpdateService/QueryUpdateLogRecordsResponse</a:Action><a:RelatesTo>urn:uuid:413f419c-f489-44ea-bd12-dff6f24a4d71</a:RelatesTo></s:Header><s:Body><QueryUpdateLogRecordsResponse xmlns="http://tempuri.org/"><QueryUpdateLogRecordsResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema"><XObject.m_element i:type="x:string" xmlns="">&lt;QueryResult Count="2" NextStart="0" PreviousStart="0" Id="{AD62FD77-AFBE-4362-BBEF-695DA5D92640}"&gt;&lt;Columns Count="33"&gt;&lt;Column AttributeName="Id" 
    … 5 pages later…
    DateModified="2014-07-06 07:34:41.9129549-07:00" /&gt;&lt;/Records&gt;&lt;/QueryResult&gt;</XObject.m_element></QueryUpdateLogRecordsResult></QueryUpdateLogRecordsResponse></s:Body></s:Envelope>
    --uuid:18cb22a2-11cc-43f4-bfea-c213da179d30+id=157—
    DECLARE
       l_request             VARCHAR2 (4000);
       l_http_req            UTL_HTTP.req;
       l_http_resp           UTL_HTTP.resp;
       v_buffer              VARCHAR2 (32767);
       n_next_start_record   NUMBER (20) := 1;
       l_response            CLOB;
    BEGIN
       -- Call webservices. Works fine
       l_request :=
             '--uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=2'
          || CHR (13)
          || CHR (10)
          || 'Content-ID: <http://tempuri.org/0>'
          || CHR (13)
          || CHR (10)
          || 'Content-Transfer-Encoding: 8bit'
          || CHR (13)
          || CHR (10)
          || 'Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"'
          || CHR (13)
          || CHR (10)
          || CHR (13)
          || CHR (10)
          || '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://tempuri.org/IUpdateService/QueryUpdateLogRecords</a:Action><a:MessageID>urn:uuid:413f419c-f489-44ea-bd12-dff6f24a4d71</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://dexdb5/DexNETWebServices_4_0_0_4/UpdateService.svc</a:To></s:Header><s:Body><QueryUpdateLogRecords xmlns="http://tempuri.org/"><context xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema"><XObject.m_element i:type="x:string" xmlns="">&lt;OnlineContext SystemId="'
          || g_system_id
          || '" SessionId="'
          || g_session_id
          || '" UserId="'
          || g_user_id
          || '" /&gt;</XObject.m_element></context><xQueryRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema"><XObject.m_element i:type="x:string" xmlns="">&lt;QueryRequest Start="'
          || p_next_start_record
          || '" Count="'
          || g_records_count
          || '" Distinct="0" OrderBy="" Condition="(oUpdateLog.DateCreated &amp;gt;= '''
          || p_last_load_time
          || ''')" ColumnInfo="1" /&gt;</XObject.m_element></xQueryRequest></QueryUpdateLogRecords></s:Body></s:Envelope>'
          || CHR (13)
          || CHR (10)
          || '--uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=2--';
       l_http_req :=
          UTL_HTTP.begin_request (g_query_updatelog_records_url, 'POST', 'HTTP/1.1');
       UTL_HTTP.set_header (l_http_req, 'MIME-Version', '1.0');
       UTL_HTTP.set_header (
          l_http_req,
          'Content-Type',
          'multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=2";start-info="application/soap+xml"');
       UTL_HTTP.set_header (
          l_http_req,
          'VsDebuggerCausalityData',
          'uIDPo5F/qXRc4YJImqB6Ard30cQAAAAAAjIXinpIVUulXLJOsSG7yyv7Lf2yHgpHlIxvc6oeqaAACQAA');
       UTL_HTTP.set_header (l_http_req, 'Content-Length', LENGTH (l_request));
       UTL_HTTP.write_text (l_http_req, l_request);
       DBMS_LOB.createtemporary (l_response, FALSE);
       l_http_resp := UTL_HTTP.get_response (l_http_req);
       BEGIN
          LOOP
             UTL_HTTP.read_text (l_http_resp, v_buffer, 32767);
             DBMS_OUTPUT.put_line (v_buffer);
             DBMS_LOB.writeappend (l_response, LENGTH (v_buffer), v_buffer);
          END LOOP;
       EXCEPTION
          WHEN UTL_HTTP.end_of_body
          THEN
             NULL;
       END;
       UTL_HTTP.end_response (l_http_resp);
       l_response := DBMS_XMLGEN.CONVERT (xmldata => l_response, flag => 1);
       -- Extract the soap envelope from clob. Issue because of the 32767 characters limitation
       SELECT    DBMS_LOB.SUBSTR (                  -- Problem here
                    l_response,
                      INSTR (l_response, 's:Envelope>', -1)
                    - INSTR (l_response, '<s:Envelope'),
                    INSTR (l_response, '<s:Envelope'))
              || 's:Envelope>'
         INTO l_response
         FROM DUAL;
          -- Parse the xml. Works fine once the above issue is fixed
          SELECT xt.nextstart
            INTO n_next_start_record
            FROM XMLTABLE (
                    xmlnamespaces ('http://www.w3.org/2003/05/soap-envelope' AS "s",
                                   'http://tempuri.org/' AS "data"),
                    's:Envelope/s:Body/data:QueryUpdateLogRecordsResponse/data:QueryUpdateLogRecordsResult/XObject.m_element/QueryResult'
                    PASSING xmltype (l_response)
                    COLUMNS nextstart NUMBER (20) PATH '@NextStart') xt;
       DBMS_OUTPUT.put_line ('NextStart ' || n_next_start_record);
    END;

  • Drag and Drop between two JTrees (urgent)

    Hello,
    I want to drag a node from one JTree and Drop it to another JTree, but it is not working, I am able to Drag from JTree and drop that on Label successfully. I didn't get any tutorial regarding my problem. If anyone of you have made it. Can you please show me your code.
    Thanks in advance.
    jStudent3

    Can you please pass on the code for dragging and dropping node between two JTree? I would be glad if u cud help me. Plz mail the code to [email protected]
    thanks
    adithya

  • Wireless application for files exchange between two computers,pls Help

    Hi everyone,
    I need your help,pls.I have to make a wireless application for files exchange between two computers,but I don't know where to start from.I guess that this should be a client/server and after establishing a connection I have to be able to exchange files between each others.Please help me

    the wireless connection does not matter.
    This is a socket (client server as you said) same way.
    look out:
    http://java.sun.com/docs/books/tutorial/networking/index.html
    cya

  • Material Comparision between two clients

    Dear Friends,
    We want to compare material between two clients. The material has same material characterstics in both client. Is it there is any std. functional module to search it? There is one FM i got CLS_SEARCH_OBJECT but it gives short dump at selectiont tab.
    Kindly give me solution as it is urgent
    Waiting for the reply,
    Thank you,
    Nilesh Shete

    Hello Nilesh,
    This is the first time that I'm coming across such a requirement of such a kind. You can easily compare the materials in two different systems. But within the same system it is difficult to compare between two clients, since the oncept of a client basically exists to separate the data.
    One crude method is:
    data: mara_1 type mara,
          mara_2 type mara.  
    data: client_1 type mandt,
          client_2 type mandt.
    data : material_1 type matnr,     
           material_2 type matnr.
    select single *
      from mara
      client specified
      into mara_1
      where mandt = client_1
        and matnr = material_1.
    select single *
      from mara
    client specified
      into mara_2
      where mandt = client_2
        and matnr = material_2.
    check mara_1 eq mara_2.
    I did not understand what you mean by "....same material characteristics.." do you realize that <i>characteristics</i> has a specific meaning in the context of a material in MM ? And if yes, are you referring to that ?
    Regards,
    Anand Mandalika.

  • Sync between two controls - Please help.. Fast response is appriciated !!

    Hi,
    I simply wish to sync two controls in the following way:
    1. I have Control A displaying three values (like a combo box) which
    cannot be changed by the user, for example: X, Y, Z
    2. The second control, Control B, has defualt value, say 100, however
    the user can change its value when the application is operated
    3. The user first select Control A value then he set Control B value,
    for example for Control A's value X he sets Control B's value to 150,
    for Control's A value Y he assigns Control's B value to 250 and for
    Control's A value Z he assigns 450
    The problem starts when i switch between Control A's values (states),
    the values of Control B were not kept
    Hope i explained it ok..
    Can someone please assist me???
    Thanks

    Hi,
    I am not sure I understand exactly what you are trying to do
    If you want Control B to be automatically set to a value that depending on Control A's state, you can use a local variable and a LUT (look up table) in wich you asign a Control B's value for each Control A's state.
    Or it's even easier with a combo box since you can use it as a LUT by disabling "Values match labels"
    Check example attached.
    Hope this helps
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    example2.vi ‏23 KB

  • Problem in comparision of two strings.please help..

    I am retriving a string password from database and another string from html(user entered one).when i am printing those two strings its printing same strings.But whenever i am comparing strings and printing its not showing equal it is printing as false.what might be the reason.please help me regarding this.Thank you in advance.My cosing is as follows:
    while(rs.next())
    pwd=rs.getString("password");
    System.out.println("pmfg is..."+pwd);
    System.out.println("first string..."+pwd);
    System.out.println("second string..."+loginpwd);
    if(pwd.equals(loginpwd))
    System.out.println("true.....");
    else
    System.out.println("false....");

    once you got two string objects ......forget for where they are comming (database or html0 ....focus on those objects ....do the following
    1) use trim() function on both strings which removes the whitespaces from front and end
    2) use equalsIgnoreCase
    if the problem still persists ....then forget your code and sue the SUN people

  • Replacing one column value between two rows..help??

    HI,
    I have table T
    it has five columns, all are in number data type
    Col1 and col2 are jointly primary key i.e. they cannot be repeated combined
    when i run this query..
    SQL> Select * from t
    it shows me the data like this
    Col1        Col2              Col3       Col4           Col5
    1             1               78          58            12.76
    2             1               128         446           32.10
    3             1               468         566           52.10
    4             1               878         58            52.05
    5             1               987         348           22.02
    ... so on.
    my requirement is that i want to update this table by replacing the col1 value between any two rows
    suppose this is the first row
    Col1        Col2          Col3        Col4         Col5
    1             1             78          58        12.76
    and this is any 2nd row
    Col1        Col2          Col3        Col4        Col5
    5             1            987         348       22.02
    now i want that for first row the value of col1 replaces the value of col1 of 2nd row
    and for 2nd row the value of col1 replaces the value of col1 of 1st row
    i.e.
    Col1        Col2          Col3        Col4         Col5
    5             1            78           58         12.76
    Col1        Col2          Col3        Col4         Col5
    1             1            987        348          22.02
    please tell how to achieve this in single query/procedureregards,
    Ramis

    SQL> create table t (id1 number, id2 number, name varchar2(1));
    Table created.
    SQL> alter table t add primary key (id1,id2);
    Table altered.
    SQL> insert into t values(1,1,'A');
    1 row created.
    SQL> insert into t values(5,1,'B');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t;
           ID1        ID2 N
             1          1 A
             5          1 B
    SQL> var val1 number
    SQL> var val2 number
    SQL> exec :val1 := 1;
    PL/SQL procedure successfully completed.
    SQL> exec :val2 := 5;
    PL/SQL procedure successfully completed.
    SQL> update t set id1 = (:val1 + :val2) - id1 where id1 in (:val1,:val2);
    2 rows updated.
    SQL> select * from t;
           ID1        ID2 N
             5          1 A
             1          1 B
    SQL> rollback;
    Rollback complete.
    SQL> select * from t;
           ID1        ID2 N
             1          1 A
             5          1 B
    SQL> commit;
    Commit complete.
    SQL> update t set id1 = decode(id1,:val1,:val2,:val1)
      2  where id1 in (:val1, :val2);
    2 rows updated.
    SQL> select * from t;
           ID1        ID2 N
             5          1 A
             1          1 BRgds.

  • How can we share  setting Header between two servlets-Urgent

    Hi ,
    I have setting one Header on my 1st servlet and but I need to access same header on my 2nd servlet. Please tell me how can I solve this issues?
    Regards,
    Pattanaik

    Sorry, misread the first time.
    As long as you don't write to the body of the response in the first servlet, you should be able to write to the header in the second. So is your problem that both servlets try to write to the body of the response?
    Edited by: paulcw on Nov 12, 2007 9:07 PM

  • Extract substrings between two words

    public class test
      public static void testing()
         String text = "<div>teext</div>sdfaf<div id='ii'>wwwwwww</div><div>nice</div>";
         String left = "<div>";
         String right = "</div>";
         int start = text.indexOf(left);
         int end = text.indexOf(right);
         int linkNum = 0;
         String[] parts = new String[50];
         while ((start = text.indexOf(left, start)) != -1) {
              start = text.indexOf(left, start);
              end = text.indexOf(right, end);
              parts[linkNum] = left + text.substring(start+1, text.indexOf(left, start+1));
              linkNum++;
              start = (end + 1);
         for (int i=0; i<parts.length; i++)     {
              System.out.println("find: " + parts);
    public static void main(String[] args) throws Exception {
         testing();
    must output
    find: teext
    find: nice
    but i have the following error
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -42
            at java.lang.String.substring(String.java:1444)
            at test.testing(test.java:15)
            at test.main(test.java:24)
    Press any key to continue...
    Can you plese tell me what's the problem ? Tnx
    Edited by: beginner1983 on Jun 8, 2009 7:14 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    String regex = "(?s)(?<=<div>).*?(?=</div>)"; That will work in this case because the start tags don't contain any attributes. If there may be attributes, and you don't know or care which attributes and values will be present, you would use something like this for the start tag: "<div[^<>]*>"; But you can't use that in a lookbehind, because there's no obvious upper limit to the number of characters it can match. (That requirement is peculiar to Java, by the way; among other regex flavors, some permit only fixed-length matches in lookbehinds, while others place no restrictions on them at all.)
    I'm with da.futt on this point: lookarounds should never be your first resort. Lookbehinds, especially, are much trickier than most people expect on first encountering them. You tend to find yourself going through ridiculous contortions trying to fit them into the overall regex. Lookaheads are much easier to work with, but you have to be careful to keep them in sync with your expectations; the can be slippery.
    In this case, your first impulse should have been to do a straight match of the whole element, with a capturing group to extract the element's content: String regex = "(?s)<div>(.*?)</div>";
    while (m.find()) {
        System.out.println(m.group(1));
    } By the way, my copy of the [Regular Expressions Cookbook|http://www.amazon.com/gp/product/0596520689?ie=UTF8&tag=jgsbookselection&linkCode=as2&camp=1789&creative=390957&creativeASIN=0596520689] arrived the other day, and it did not disappoint. Good, solid stuff there.

  • How to remove line between two raws in word template designing ?

    Hi everbody,
    Hope you are doing good.
    i am designing report in word template.
    i wandoring how to remove line between two raws ?
    currently it gives me lines between each single raw.
    i want to remove line between two raws.
    any help is greatly appreciated.
    Thanks.

    Hi,
    are the rows inside a table-structure? Perhaps the line are the borders of the table?
    Regards
    Rainer

  • How to write select statement between two tables

    hi,
    i need to do comparision between two table for each records.ex:
    table1:
    regid            regno         ind
    1                 1001
    1                 1002
    1                 1003
    1                  1004
    and table2:
    regid           regno
    1               1002
    1                1005
    i need to select first row from table and loop for values in second table, if the values found first record , the record must update 'yes' to ind, if not 'No'.
    please help with this.
    thanks in advance
    raja

    Hi Raja,
      Do it like this.  loop  the first table and read the second table.
    Use where condition to satisfy the conditions.
    Or
    In your select query use joins. Like this.
    SELECT mara~matnr
           marc~werks
    INTO   TABLE t_material
    FROM   mara AS mara INNER JOIN marc AS marc
    ON     maramatnr = marcmatnr
    WHERE  mara~mtart = p_mtart.
    Instead of MARA and MARC here use your tables.
    Much Regards,
    Amuktha.

  • How to calculate  number of sundays and saturdays between two Dates

    friends i want to calculate how many Sundays come in two Dates
    i have tried following code which is hard coded i have to impliment method which can give me number of Sundays between two Dates
    please help me
    import java.util.Date;
         import java.text.DateFormat;
         import java.text.SimpleDateFormat;
         import java.util.Calendar ;
         import java.util.GregorianCalendar;
    public class DateDiffCalculator     {
         private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MMM-dd");
    public DateDiffCalculator()     {
         public static Date getDate (String date) throws Exception {
    //log.debug(" "+date);
              return SDF.parse(date);
    public static Date getDate (Date date) throws Exception {
    // log.debug("date is "+date);
              return getDate(SDF.format(date));
    public static long getDiffInDays(Date d1,Date d2)     {
         boolean isdiffGreaterThanYear=false;
         long diffInMilliSeconds=d1.getTime()-d2.getTime();
         return diffInMilliSeconds/(1000*60*60*24);
    public static int getYear(String date)     {
              //String[] day=     {Sun,Mon,Tue,Wed,Thu,Fri,Sat};
              Integer     year=new     Integer(date.substring(0,4));
         return year.intValue();
    public static int getMonth(String date)     {
              //String date.substring(5,7);
              System.out.println(" "+date.substring(5,8));
              String     m= date.substring(5,8);
              int month=0;
              if(m.equalsIgnoreCase("Jan"))     {
              month=1;
              if(m.equalsIgnoreCase("Feb"))     {
              month=2;
              if(m.equalsIgnoreCase("Mar"))     {
              month=3;
              if(m.equalsIgnoreCase("Apr"))     {
              month=4;
              if(m.equalsIgnoreCase("May"))     {
              month=5;
              if(m.equalsIgnoreCase("Jun"))     {
              month=6;
              if(m.equalsIgnoreCase("Jul"))     {
              month=7;
              if(m.equalsIgnoreCase("Aug"))     {
              month=8;
              if(m.equalsIgnoreCase("Sep"))     {
              month=9;
              if(m.equalsIgnoreCase("Oct"))     {
              month=10;
              if(m.equalsIgnoreCase("Nov"))     {
              month=11;
              if(m.equalsIgnoreCase("Dec"))     {
              month=12;
              return month;
         public static int getDay(String date)     {
              Integer     day=new     Integer(date.substring(9,11));
         return day.intValue();
    public static int getNumberofSundays(String d1,String d2) throws Exception     {
              //d1 is leave start date d2 is leave end date
              // get object in Date form
                   Date date1=getDate(d1);
                   Date date2=getDate(d2);
              // now get calender objects from it
              GregorianCalendar c1= new GregorianCalendar(getYear(d1),getMonth(d1),getDay(d1));
              GregorianCalendar c2= new GregorianCalendar(getYear(d2),getMonth(d2),getDay(d2));
              // get period
              long leavePeriod = getDiffInDays(date1,date2);
         return 12; // it should return number of sundays but we type 12 to perform compilation
    public static void main(String[] arg)throws Exception     {
    System.out.println(" "+getNumberofSundays("2005-Oct-07","2006-Mar-01"));
    }

    thanks now i have modified the get Month Code
    as follows
    public static int getMonth(String date)     {
              //String date.substring(5,7);
              System.out.println(" "+date.substring(5,8));
              String     m= date.substring(5,8);
              int month=0;
              if(m.equalsIgnoreCase("Jan"))     {
              month=0;
              if(m.equalsIgnoreCase("Feb"))     {
              month=1;
              if(m.equalsIgnoreCase("Mar"))     {
              month=2;
              if(m.equalsIgnoreCase("Apr"))     {
              month=3;
              if(m.equalsIgnoreCase("May"))     {
              month=4;
              if(m.equalsIgnoreCase("Jun"))     {
              month=5;
              if(m.equalsIgnoreCase("Jul"))     {
              month=6;
              if(m.equalsIgnoreCase("Aug"))     {
              month=7;
              if(m.equalsIgnoreCase("Sep"))     {
              month=8;
              if(m.equalsIgnoreCase("Oct"))     {
              month=9;
              if(m.equalsIgnoreCase("Nov"))     {
              month=10;
              if(m.equalsIgnoreCase("Dec"))     {
              month=11;
              return month;
    but question remains same how to calculate number of Sundays Between 2 Dates

  • [Urgent] Need help calculating difference between two dates

    I'm trying to write a code to display the current day and time, then accept two dates from the user and display the difference between the two dates. To display the current date and time, I've used the SimpleDateFormatter library but I'm having difficulty calculating the difference between two dates. Could someone please help me with this?
    Below is my code so far
    import java.util.Date;
    import java.util.Scanner;
    import java.text.SimpleDateFormat;
    public class DateFormatter {
         public void displayNow()
              Date todaysDate = new Date();
              SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss");
              String formattedDate = formatter.format(todaysDate);
              System.out.println("Today's date and time is: "+formattedDate);
         public void calculateDifference(Date startDate, Date endDate)
              /* This is whre i need help! */
         public static void main(String[] args)
              DateFormatter df = new DateFormatter();
              Scanner sc = new Scanner(System.in);
              df.displayNow();
              System.out.println("Please enter a date: ");
              String date1 = sc.next();
              System.out.println("Please enter another date: ");
              String date2 = sc.next();
    }The methods displayNow() and calculateDifference(Date startDate, Date endDate) are essential and cannot be skipped out.

    tarahmarie101 wrote:
    Dude. I've tried doing assignments under pressure, and it doesn't work. Here's a piece of free advice. Start earlier next time, don't put "urgent" in the title of your post b/c it just pisses people off around here--and is a sure sign of an overdue homework assignment which no one around here likes helping with, and try to ask intelligent questions--don't just say "Help me!"
    Of course, it takes some time to learn what the intelligent questions are. You have my sympathy. Try asking questions about how to do a particular task, instead of asking people to tell you what to do. It starts to get easier after a while.
    actually dude i started on this on monday.. but there were so many other stuff to do along with this.. and i did try referring up the Calendar utility but it was a bit confusing actually.. it was only after that did i come to this forum.. nor am i very good at Java.. anyhoo thanks for your sympathies :P

Maybe you are looking for

  • Drag and drop between libraries...

    Can I drag and drop songs from one iTunes library to another? I have one main library that I don't want to change, but I would like to put some of those songs on my kids iPods (I've created separate libraries for each of them). Is this possible? TIA.

  • Lsmw problem: for mm01 basic data text two language

    Dear, I want to realize, in mm01, under 'basic data text' tab, have English and French text. I use lsmw, direct input,object:0020, method:0000, program name:RMDATIND. The basic data text function should be done in structure BMMH7. Now, I add some cod

  • Line charts: data point symbol resize?

    I'm working with charts in Pages and would like to be able to have a greater variety of lines in my line chart. In addition to selecting the data point symbol (square, circle, etc), I wish I could resize that symbol. I know I can resize the line widt

  • Possible have a jump to menu at chapter marker?

    I'm not sure how to set this up. Got a hr long show for teachers, w/34 chapters. Want to have a play all/thru capibility as well as the individual chapters. After a chapter play, and before the next, would return to the chapter menu. Is that possible

  • 'Stocks' App for I-Pad - bummer...but 'thank you' for 2 replies

    I recently asked a question regarding the availability of an I-Phone App ('Stocks') for downloading to an I-Pad. I have NO idea how to reply to the two people who (partially) answered my query i.e. on the screen where I can see their replies, there i