Find the intersection/union between two cards

Hello.
I'm trying to find out the changes of State between the two cards.
I have two cards A and B, what I need to do is to find keys in A that exists in key and B in B that does not exist in a..
If the key exists in both A and B I want to compare the values of these keys.
What would be the most effective way to apply it.
My first plan was to make a loop on the keys has to find b and browse the keys b and find in A, but I guess that there is a more efficient algorithm.
I think also on the use of java.util.Collections to find union-intersection between the keys in the cards, but then I need to do a search in the two
maps.
Any suggestions?
Concerning
/ Fredrik

Fredrik wrote:
My script is as follows:
I am writing a Swing application for administration of a clustered environment.
The keys in the map contains the ip address of the cluster nodes, the value is a State of a node in the cluster.
I want to report the change of State of the node in the GUI.
A state change occurs if there is a new node in the cluster, which means a new entry to the card since the last audit, or if a node
Let the cluster has remove entry on the map since the last audit, or if the situation or condition for entry/ip has changed since the last audit.
Concerning
/ Fredrik

By your senario above, I don't think that you have two objects on the map, there is a single object and you want to report the change in the GUI, whenever an object is the value added, deleted or by itself is changed (key is the same) to the map.

Then, I suggest below things:
(1) override hashcode and equals method. (Because each time the methods put and putAll are called the hash code equal method checks in the bucket for the equal and similar hash code and if its equal, and then change the GUI for the existing map).
(2) as suggested earlier, substitute methods of deletion. (Whenever an object is deleted, accordingly you can change the GUI).
(3) as was suggested earlier, override a method put and putAll (whenever a new object is added, so you can change the GUI).

And to do this, I don't think you have to browse the map.

Tags: Java

Similar Questions

  • Find the minimum distance between two SDO_GEOMETRY in Oracle Spatial?

    annular ring edit.png

    A circle (SDO_GEOMETRY)
    B - polygon (SDO_GEOMETRY)

    CASE:
    B contains A (or)
    The Interior of B.

    How to find the minimum distance between A and B in Oracle Spatial

    Hello guuid nameless person.

    What is

    my_answer := MDSYS.SDO_GEOM.SDO_DISTANCE(
       my_circle_geometry
      ,MDSYS.SDO_UTIL.POLYGONTOLINE(my_outer_polygon)
      ,my_tolerance
    );
    

    Now, you may need to pay attention to the holes in your polygon, would you the distance and an inner ring if it was closer to you?

    If the measure is only to outer rings, so something like

    my_answer := MDSYS.SDO_GEOM.SDO_DISTANCE(
       my_circle_geometry
      ,MDSYS.SDO_UTIL.POLYGONTOLINE(
          MDSYS.SDO_UTIL.EXTRACT(my_outer_polygon,1,1)
       )
      ,my_tolerance
    );
    

    And then also beware of the multipolygons as the foregoing only measured against the first polygon in the MultiPolygon.  You need to loop through the polygons of tests just the outer ring in this case.

    See you soon,.

    Paul

  • Find the time delay between two signals

    In this code, I sent you a pulse in the acquisition of data using labview. The pulse triggers a thermistor to another analog input input data.

    I want to find the delay between the time of the positive edge of the switch, and the exact time of the DAQ begins to take in the signal of the temperature probe.

    I enclose the code below.

    Thank you.

    Hey,.

    Here is a link to some information about the sources of clock on the FPGA.

    http://digital.NI.com/public.nsf/allkb/94CE338CC80ACF008625791400516BAA?OpenDocument

    Hope this helps

  • How to find the ANGLE b/w two edges in Oracle Spatial

    How to find the ANGLE b/w two edges on Oracle Spatial. I have two edge connected on the same node. I wanted to know the angle betwwn them. Can someone help me?

    Ok. My first example is an approximation. Further you get North or South of the Ecuador, gets the more vague.
    This one should do the trick with some degree of precision.

    declare
      PI constant number := 3.14159265358979;
      g1 sdo_geometry;
      g2 sdo_geometry;
      g3 sdo_geometry;
    
      angle1 number;
      angle2 number;
    
      FUNCTION POINT(P_LAT  IN number
                    ,P_LONG IN number)
        RETURN MDSYS.SDO_GEOMETRY IS
      BEGIN
        -- we load both the ordinate array and the point type because some spatial functions show inconsistent behavior
        -- it is not important for this example, just something to be aware of
        return(mdsys.sdo_geometry(2001,8307 -- WGS84
                                 ,mdsys.sdo_point_type(p_long,p_lat,null)
                                                      ,mdsys.sdo_elem_info_array(1,2,1)
                                                      ,mdsys.sdo_ordinate_array(p_long,p_lat)));
      END;
    
    begin
    
      -- For the example, project in WGS84
      -- g1,g2,g3 could also come straight out of the database as sdo_geometry
      g1 := point(50, 7);          -- Point A
      g2 := point(51, 7);          -- Point B
      g3 := point(50,10);          -- Point C
    
      angle1 := atan2(g2.sdo_point.x - g1.sdo_point.x,
                      g2.sdo_point.y - g1.sdo_point.y);
      angle2 := atan2(g3.sdo_point.x - g1.sdo_point.x,
                      g3.sdo_point.y - g1.sdo_point.y);
    
      -- depending on rotation and where we are on the planet, adjustments may be needed
      if angle1 < 0      then angle1 := angle1 + 2 * PI; end if;
      if angle2 < 0      then angle2 := angle2 + 2 * PI; end if;
      if angle2 < angle1 then angle2 := angle2 + 2 * PI; end if;
    
      dbms_output.put_line('Angle between the lines A-B and A-C: '||
                           round(sdo_util.convert_unit(angle2-angle1,'Radian','Degree'),1));
    end;
    
    Angle between the lines A-B and A-C: 90
    
  • Where can I find the driver of USB memory card reader software?

    Where can I find the driver of USB memory card reader software? I checked on hp.com, but he's not here.

    I use the HP Compaq dc7800 Small Form Factor and Windows 7 Home Premium SP1 x 86 and p/n: AQ532US #ABA

    Hello

    You can ask HP support and in their forums. Maybe it's an older driver still used or HP
    is wrong has not posted.

    This is the Realtek site, but he could not be there.

    Realtek - downloads
    http://www.Realtek.com/downloads/

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • How do the time difference between two dates?

    Hi all

    I use this query to get the time difference between two dates.

    Select to_timestamp ('2012-10-03 12:00 ',' YYYY-MM-DD hh)-to_timestamp ('2012-10-03 11:00 ',' YYYY-MM-DD hh) as double diff;

    but do not get the correct result.

    Thank you

    Left KEY... Left Padding of tanks.

  • Is it possible to establish the selection square between two Guides...?

    Hello world

    Is it possible to establish the square selection between two Guides. Guides are up & down (or) left and right.

    The rectangle has been fixed ratio 200 X 200. Thanks in advance.

    1.jpg

    -yajiv

    This requires Photoshop CS5 or better...

    #target photoshop
    app.bringToFront();
    main();
    function main(){
    if(app.version.match(/\d+/) < 12) return;
    if(!documents.length) return;
    var doc = activeDocument;
    var guides = doc.guides;
    if(guides.length != 2) return;
    if(guides[0].direction != guides[1].direction) return;
    var startRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    var SB = new Array();
    if(guides[0].direction == Direction.HORIZONTAL && guides[1].direction == Direction.HORIZONTAL){
    var vertDistance = doc.guides[1].coordinate.value - doc.guides[0].coordinate.value;
    SB[0] = (doc.width.value - vertDistance)/2;
    SB[1] = doc.guides[0].coordinate.value;
    SB[2] =  ((doc.width.value - vertDistance)/2)+vertDistance;
    SB[3] = doc.guides[1].coordinate.value;
        }
    if(guides[0].direction == Direction.VERTICAL && guides[1].direction == Direction.VERTICAL){
    var horzDistance = doc.guides[1].coordinate.value - doc.guides[0].coordinate.value;
    SB[0] = doc.guides[0].coordinate.value;
    SB[1] = (doc.height - horzDistance)/2;
    SB[2] = doc.guides[1].coordinate.value;
    SB[3] = ((doc.height - horzDistance)/2)+horzDistance;
        }
    activeDocument.selection.select([[SB[0],SB[1]],[SB[2],SB[1]],[SB[2],SB[3]],[SB[0],SB[3]]], SelectionType.REPLACE, 0, false);
    app.preferences.rulerUnits = startRulerUnits;
    }
    
  • How to remove the white space between two response reports

    How to remove the white space between two response reports

    In the section of dashboard, I have 2 rqeuest. Each query returns Table view. When I view the dashboard, it shows a blank separating 2 table views. How can I get rid of the band of white/white space?

    See this link

    Re: Remove the space between the two reports on the dashboard page OBIEE Section

    Kind regards
    Sandeep

  • Illustrator CS3: How to calculate the exact distance between two points?

    It comes to my line.

    Immagine 1.jpeg

    I have to measure its exact length. How can I do?
    If I use the measure tool, the cursor does not select the snap points, so I have only an approximate measure.
    Is there a quick way to calculate the exact distance between two points?

    Flying document Info Palette menu: turn on the SelectionOnly and objects. The palette will show you the length.

    JET

  • How to write a query for the data exchange between two columns?

    How to write a query for the data exchange between two columns?

    I tried a request, does NOT work.
    update tmp t1 set t1.m1=t1.m2 and t1.m2=(select t2.m1 from tmp t2 where t2.student_id = t1.student_id)
    Thank you.

    Published by: user533361 on October 23, 2009 14:04

    Just plain and simple:

    update tmp t1
     set t1.m1=t1.m2,
         t1.m2=t1.m1
    /
    

    SY.

  • Can not find the intersection of audit in HFM 11.1.1.3

    Hi all

    CANNOT FIND AUDIT INTERSECTION OF HFM DATAGRID

    more details:

    In order to properly install the intersection of audit function, I tried to follow the "Single Sign-On and Drill - Back Setup of HFM in FDM" document which, however, is intended for 9.x.x HFM.

    Our HFM version is rather 11.1.1.3. For this reason, I couldn't filled a specific stage of the mentioned guide that is "Web HFM-server you must provide a link.
    "for FDM inside of the ' Server and Configuration of the Web.

    I checked the app and the Web server, and I'm not able to find this command.

    However, I was able to activate the link SSO between HFM and FDM, update the metadata with the FDMAppName, etc.

    At the end of the process, I have Pascal find command "intersection of audit" among the possible 'right click' choice.

    Can someone help me please?

    In this version of FDM to drill holes in you just activate the integration option "Use SSO" and the integration option "Allow to break region Load".

    This will create an additional .dat file to the HFM export loading that contains region of drilling data which are then responsible for ERPIURL and _ERPI tables database in the database of HFM.  These two paintings is what causes the "Drill with FDM" icon to display in the DataGrid HFM.

    Make sure these integration settings are enabled and then rerun your export/load to the HFM Application.

  • Can I acquire at the same time HAVE two cards of different acquisition installed on the same computer

    Here's my question:

    I have two different cards installed in a PC. Specifically, PCI-6224 and PCI-6254. I need to acquire 50 analog inputs (real time). Can I use two cards to do? I mean I can synchronize these two cards and acquire simultaneously several channels at the same time?

    Thank you

    Alessandro

    Yes. You can use a RTSI cable between them. See the examples of the expedition. If you are using LabVIEW, look at several Synch - Analog Input - Cont Acquisition devices.

  • Implementation of the linear adjustment between two sliders

    Hello

    I'm trying to implement a linear between two sliders fit as I am with altogether 4 sliders. I want to implement an adjustment linear between slider 2 & 3. Please help me how to implement and to find a slope. I also enclose my code.

    Hey Brad,

    Saw that you contacted me then here is the solution.

    In fact Cameron has already mentioned the solution above.

    In any case what it what it should look like when you implement it:

    Note: The while loop is just a claim that the output are not in the right order.

    Koen

  • Calculate the (age) years between two dates

    Nice day!

    I have not been able to find an answer, that I was able to use in the archives or online and would be very grateful for the help.  I'm working with Adobe Acrobat Pro XI (not LiveCycle) and I have very little experience with programming (for the most part, copy / paste).

    I need to create a text box that calculates the number of years between two dates entered, i.e. the age when the date of birth and death are given.  Also, would be nice if she was a Virgin until the two were provided.  Anyone would be able to give me the code I need to put in the custom calculation script?

    Once again, any help would be much appreciated!  Thank you and have a wonderful day!

    For the fields for Date of birth DOB and DOD for the Date of death and age in complete years both by using a'd-mmm-yyyy' date format you can use a custom calculation to the JavaScript for the field of age as:

    function GetField (cName) {}
    get the field with error trapping object;
    oField var = this.getField (cName);
    test error;
    if(oField == null) app.alert ("error during the" + cName, 1, 0);
    Returns the field object;
    return oField;
    } / / end GetField function;

    function {Scand (cFormat, cString)
    using date string format convert object date;
    convert string to date using format;
    Kai var = util.scand (cFormat, cString);
    the value null is an error of conversion;
    if(oDate == null) app.alert ("Conversion error" cString "by using the format" + cFormat, 1, 0);
    date of return;
    Return to oDate;
    } / / end Scand function;

    clear the value of the field;

    Event.Value ="";
    get data dob and dod;
    var oDOB = GetField ("DOB");
    Var o = GetField ("DOD");

    treat only if DOB and DOD have value and are not null;
    If (oDOB! = null & o! = null & oDOB.value! = "" & oDOD.value!) = "") {}

    convert the DOB and DOD to date objects.
    oDOB var = util.scand ("d-mmm-yyyy", oDOB.value);
    O var = util.scand ("d-mmm-yyyy", oDOD.value);

    get the difference over the years;
    var Age = oDOD.getFullYear () - oDOB.getFullYear ();

    adjust for month of previous DOD DOB;
    If (oDOD.GetMonth)< odob.getmonth())="">

    adjust the DOD before DOB date in the month of birth;

    If (oDOD.GetMonth () == oDOB.getMonth () & oDOD.getDate ())< odob.getdate())="">
    Set the value of the field;

    Event.Value = Age;
    }

  • Length of the different interval between two dates in SQL/PLSQL

    Dear gurus, here are three questions to ask:
    1. Why is the result queries are different?
    2 - is a way to measure the length of the interval in seconds (L) between two dates?
    2. why the different result is generated in SQL and PL/SQL only to subtract dates from the 28th day of the month?

    declare
    number of l_offset;
    Start
    l_offset: = (to_date('09-nov-2009') - to_date ('28.10.2009 10:40:03 ', ' dd.mm.yyyy hh24:mi:ss')) * 86400;))
    dbms_output.put_line (l_offset);
    l_offset: = (to_date('09-nov-2009') - to_date ('27.10.2009 10:40:03 ', ' dd.mm.yyyy hh24:mi:ss')) * 86400;))
    dbms_output.put_line (l_offset);
    end;
    998396.9999999999999999999999999999999997
    1084797


    Select (to_date('09-nov-2009') - to_date ('28.10.2009 10:40:03 ', ' dd.mm.yyyy hh24:mi:ss')) * double 86400))
    Union of all the
    Select (to_date('09-nov-2009') - to_date ('27.10.2009 10:40:03 ', ' dd.mm.yyyy hh24:mi:ss')) * double 86400))
    (TO_DATE('09-NOV-2009')-TO_DAT
    998397
    1084797


    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    PL/SQL Release 9.2.0.7.0 - Production
    CORE 9.2.0.7.0 Production
    AMT for Linux: release 9.2.0.7.0 - Production
    NLSRTL Version 9.2.0.7.0 - Production

    Hello

    Sorry, I'm still not sure you understand the question.

    You wonder why the rounding error is apparent to 6 digits to the left of the decimal separator in numbers, but not in number 7 digits to the left of the decomal? The answer is itself a rounding error.
    When Oracle is the arithmetic mean of the dates, the result is a fraction that cannot be stored in a binary number, such as preciesly
    998396.9999999999999999999999999999999996857... it it rounds to the nearest value it can store, such as
    998396.9999999999999999999999999999999997. in other words, it can store 40 digits. In this case, 6 figures to the left of the decimal separator and 34 of the figures to the right. The number is rounded to the nearest multiple of 10 ^-34 ^
    What happens if we add 86400 this number?

    
     998396.9999999999999999999999999999999997
    + 86400.0000000000000000000000000000000000
    ------------------------------------------
    1084796.9999999999999999999999999999999997
    

    Now we need 7 digits before the comma, then round the number to the nearest multiple of 10 ^-33 ^, which is
    1084797.000000000000000000000000000000000

Maybe you are looking for

  • Synchronization of input / output

    Hello I need your help to synchronize a digital output with a digital input with LabVIEW 8.2. I have a PCI NI6289 card. A digital output behaves like the green signal on the following diagram. I need to generate the blue signal on a digital output, k

  • laptop not running on battery power, does not work on current alternative

    Mobile works only with the battery will not work when the power supply is connected, it only works on battery when the battery is empty, says to plug in the power cord support will be appreciated

  • To add another disk for HP a6430f desktop

    Product: Office KJ378AA-a6430f OS: Vista, which is updated automatically I want to add a HDD that is identical to one already installed in the system. This player is WDC WD64 00AAKKS-65A7B SCSI. I looked inside of the Cabinet Office and there is room

  • You need to reinstall Win 7 Home Basic which entered the pre-installed on Dell Inspiron n5010 laptop.

    Hello IAM using dell inspiron n5010 Lapop who came from Windows 7 Home Basic... I could not find my product key during that... later I installed trial windows 7 ultimate... so far I'm used it... now, I would like to install pre installed win 7 Home b

  • pp cc 2014 import audio prob

    Help please! tried to import the audio and the video in pp cc2014 is out of sync video will drop its never done that before? the map file is all good.shot on canon c100 avchd. This could be a problem of update? using a mac