Mapping - split followed by set operation

Hi I'm trying to set up a mapping to use as part of testing my warehouse and need some help.
Overview
======
I have a number of different databases that combine through to my operational data store. One verification of our mappings is a simple check of record counts, source table vs target.
Because table names differ between source and target I have loaded (from a flat file) a translation table that maps one table name to another.
I have external SQL scripts that run on a scheduled basis to capture table names, record counts and date of last update from the system tables of four of my source databases and my target database. (soon I'll need to try and replace these with OWB scripts)
I am trying to build a mapping to conform these so I end up with a single fact listing target table, record count, update date, source table, source environment, record count, update date.
I have taken my statistics on the target database, outer Joined it to the translation table (not all target tables have matching translation table records)
Then split the result set by target environment (and remainder)
Then I join each result set to the statistics for the appropriate source.
Next I am using a set operation to union all the results back to my conformed result.
My Problem
=========
Those tables in the target database that do not correspond to a table in one of the four sources cause a problem. (they are either summary facts, flat files loaded or sourced from other databases I have not got statistics on yet)
I can’t just link from the split’s output set to the set operation because the other joins have added extra fields for number of records in the source. The documentation is very clear that the same fields must exist in the same order and datatype.
I have been trying to work out which mapping operation/s will produce the equivalent of SQL like “select col1, col2, null, sysdate, null from mytable”
Hmm as I type this up I think another alternative may be to output extra fields in the split (so it looks like the dataset after the join) but not to pass these fields on in the join for sets for specific environments. I’ll try that alternative but would still like help with which mapping operator I could have used.

Can I have a little bit more technical information : A small exmaple would be very helpful.
Regards
-Arnab

Similar Messages

  • RFE Proposal Set Operations - RFC

    Greetings, this is a proposal for a Request for Enhancement in the JDK. It
    is posted here for the review and comment. Basically an RFC on a RFE. =)
    Please indicate your comments on the matter.
    The proposal is to have a set of operations for perfomring Non-destructive
    mathematical set operations on collections. Additionally, the addition of
    set operations to rename the old operations int java.util.Collection
    interface to names that are mathematically accurate; so that
    removeAll(Collection c) would have an alias of difference(Collection c) and
    retainAll(Collection c) would have a alias of intersection(Collection c).
    The following methods would be added to the java.util.Collections class.
    * Performs the non-descturctive union of two collections.
    * The resulting collection is the union of the two collections with no
    duplicates.
    * @author Robert Simmons Jr.
    * @param a The first collection of objects.
    * @param b The second collection of objects.
    * @return The collection wise union of and b.
    public final static Collection collectionUnion(final Collection a, final
    Collection b) {
      Collection results = new HashSet(a);
      Iterator iter = b.iterator();
      while (iter.hasNext())
      results.add(iter.next());
      return results;
    * Performs the intersection of two collections.
    * The resulting collection is the intersection of the two collections with
    no duplicates.
    * @author Robert Simmons Jr.
    * @param a The first collection of objects.
    * @param b The second collection of objects.
    * @return The collection wise intersection of a and b.
    public final static Collection collectionIntersection(final Collection a,
    final Collection b) {
      Collection results = new HashSet();
      Iterator iter = a.iterator();
      Object element = null;
      while (iter.hasNext()) {
        element = iter.next();
        if (b.contains(element)) results.add(element);
      return results;
    * Performs the difference of two collections.
    * Removes all elements from a that appear in b.
    * @author Robert Simmons Jr.
    * @param a The first collection of objects.
    * @param b The second collection of objects.
    * @return The collection wise difference of b elements removed from a.
    public final static Collection collectionDifference(final Collection a,
    final Collection b) {
      Collection results = new HashSet(a);
      Iterator iter = b.iterator();
      while (iter.hasNext())
        results.remove(iter.next());
      return results;
    * Performs the XOR union of two collections.
    * The resulting collection is the union of the two collections with objects
    that appear in
    * a and b left out.
    * @author Robert Simmons Jr.
    * @param a The first collection of objects.
    * @param b The second collection of objects.
    * @return The collection wise union of a and b excluding any objects that
    appear in both a and b.
    public final static Collection collectionXORUnion(final Collection a, final
    Collection b) {
      Collection results = new HashSet(a);
      Iterator iter = b.iterator();
      Object element = null;
      while (iter.hasNext()) {
        element = iter.next();
        if (!(b.contains(element))) results.add(element);
      return results;
    * Performs the union of two maps.
    * The resulting map is the union of the two maps with no duplicates.
    * When working with set operations on a map, the set is assumed to be the
    key set. For
    * this reason, if both sets have the same key but different values then the
    value from
    * set b will beused as the value.
    * @author Robert Simmons Jr.
    * @param a The first map of objects.
    * @param b The second map of objects.
    * @return The map wise union of and b.
    public final static Map mapUnion(final Map a, final Map b) {
      Map results = new HashMap(a);
      Iterator iter = b.keySet().iterator();
      Object key = null;
      while (iter.hasNext()) {
        key = iter.next();
        results.put(key, b.get(key));
      return results;
    * Performs the intersection of two maps.
    * The resulting map is the intersection of the two maps with no duplicates.
    * When working with set operations on a map, the set is assumed to be the
    key set. For
    * this reason, if both sets have the same key but different values then the
    value from
    * set b will beused as the value.
    * @author Robert Simmons Jr.
    * @param a The first map of objects.
    * @param b The second map of objects.
    * @return The map wise intersection of a and b.
    public final static Map mapIntersection(final Map a, final Map b) {
      Map results = new HashMap();
      Iterator iter = a.keySet().iterator();
      Set bKeys = b.keySet();
      Object key = null;
      while (iter.hasNext()) {
        key = iter.next();
        if (bKeys.contains(key)) results.put(key, b.get(key));
      return results;
    * Performs the difference of two maps.
    * Removes all elements from a that appear in b.
    * In this case, the set is determined to be the set of keys. The set of
    keys from
    * b will be used to remove keys from a.
    * @author Robert Simmons Jr.
    * @param a The first map of objects.
    * @param b The second map of objects.
    * @return The map wise difference of b elements removed from a.
    public final static Map mapDifference(final Map a, final Map b) {
      Map results = new HashMap(a);
      Iterator iter = b.keySet().iterator();
      while (iter.hasNext())
      results.remove(iter.next());
      return results;
    * Performs the XOR union of two maps.
    * The resulting map is the union of the two maps with objects that appear
    in
    * a and b left out.
    * When working with set operations on a map, the set is assumed to be the
    key set. For
    * this reason, if both sets have the same key but different values then the
    value from
    * set b will beused as the value.
    * @author Robert Simmons Jr.
    * @param a The first map of objects.
    * @param b The second map of objects.
    * @return The map wise union of a and b excluding any objects that appear
    in both a and b.
    public final static Map mapXORUnion(final Map a, final Map b) {
      Map results = new HashMap();
      Iterator iter = a.keySet().iterator();
      Set bKeys = b.keySet();
      Object key = null;
      while (iter.hasNext()) {
        key = iter.next();
        if (!(bKeys.contains(key))) results.put(key, b.get(key));
      return results;
    }Transcript of mail session with Sun java developer after bug submission:
    Hi Robert Simmons Jr.,
    Thank you for the feedback.
    The method names in java.util.Set conform to the parent interface,
    java.util.Collection. As for the destruction situation, returning a new set
    also would involve creating and populating a new set.
    If you would like to pursue this Request for Feature Enhancement (RFE)
    further,
    I would suggest that you first post this idea to a newsgroup and request
    comment from other Java developers. The issues that we have discussed are a
    good starting point.
    You can view a list of Java newsgroups at:
    http://java.sun.com/aboutJava/newsgroups.html
    Based on the responses, please feel free to submit a new RFE containing a
    link to the newsgroup. Thank you for your time.
    Regards,
    Jonathan
    "Simmons, Robert" wrote:
    >
    I understand your reply now. However I put it to you that the names ofthese
    operations are HORRIBLY named. They should be named according to the
    mathematical operations. Further, they are destructive to the set being
    checked and I dont want that. The set operations should give me back a set
    and not destroy the current set. If they destroy the current set then Ihave
    to spend time copying the thing before I run the set operation which is
    truly not performant. Do an intersection of 400,000 elements with anotherfo
    300,000 elements and you have to first copy one and then the retain all
    method has to iterate through the entire set. This is very bad logic. Inthe
    code I gave you, you have to only iterate through the set and not copy it.>
    ----------------- Original Bug Report-------------------
    category : java
    release : 1.4
    subcategory : classes_util
    type : rfe
    synopsis : java.util.Collections Class Should Implement Logical Set
    Operations
    description : FULL PRODUCT VERSION :
    This issue is pertinent to all java versions including the new 1.4 version.
    FULL OPERATING SYSTEM VERSION : Occurs in all operating
    Systems.
    ADDITIONAL OPERATING SYSTEMS : NA
    A DESCRIPTION OF THE PROBLEM :
    The java.util.Collections class is a class that is used to
    manipulate sets and change them into various forms. Missing
    from this is a feature that would define set operations,
    such as Union, Intersection, and so on on the sets. This
    would be extremely beneficial. I have written an extension
    to this class that does just that and would like to submit
    it for donation. All I ask is that the javadoc tag naming
    me as author be retained.
    This bug can be reproduced always.
    ---------- BEGIN SOURCE ----------
    <!-- snip source .. see above -->
    ---------- END SOURCE ----------
    CUSTOMER WORKAROUND :
    Writing your own classes to do this, however it is so basic
    that it should be in there.
    workaround :
    suggested_val :
    cust_name : Robert Simmons Jr.
    cust_email : [email protected]
    jdcid : Derisor (old one was gnuish)
    keyword : webbug
    company : Ingeniums Pharmaceuticals AG
    hardware : x86
    OSversion : Linux
    bugtraqID : 0
    dateCreated : 2002-03-11 13:31:18.3
    dateEvaluated : 2002-04-11 18:08:17.247
    Robert Simmons Jr.
    Senior Software Engineer
    Ingenium Pharmaceuticals, Munich Germany.
    Robert Simmons Jr.
    Senior Software Engineer
    Ingenium Pharmaceuticals, Munich Germany.
    Robert Simmons Jr.
    Senior Software Engineer
    Ingenium Pharmaceuticals, Munich Germany.

    Additional Bump. Seeking comments.

  • Problem in Adhoc Query's set operation functionality.

    Hi Experts,
    I am facing problem executing Adhoc Query's set operation functionality.
    In Selection Tab, following operations are performed :-
    Execute a query and mark it as 'Set A'.(Say Hit list = X)
    Execute another query and mark it as 'Set B'.(Say Hit list = Y)
    In Set operation Tab, following operations are performed :-:-
    Carry out an Operations 'Set A minus Set B'.
    which results in Resulting Set = Z.
    Transfer the resulting set 'in hit list' and press the copy resulting set button.
    In Selection Tab, Hit list is populated with Z.
    And when output button is pressed, I get to see 'Y' list and not 'Z' list.
    Kindly help.
    Thanks.
    Yogesh

    Hi Experts,
    I am facing problem executing Adhoc Query's set operation functionality.
    In Selection Tab, following operations are performed :-
    Execute a query and mark it as 'Set A'.(Say Hit list = X)
    Execute another query and mark it as 'Set B'.(Say Hit list = Y)
    In Set operation Tab, following operations are performed :-:-
    Carry out an Operations 'Set A minus Set B'.
    which results in Resulting Set = Z.
    Transfer the resulting set 'in hit list' and press the copy resulting set button.
    In Selection Tab, Hit list is populated with Z.
    And when output button is pressed, I get to see 'Y' list and not 'Z' list.
    Kindly help.
    Thanks.
    Yogesh

  • Set operations & tables with different columns

    I have a problem. I have 3 tables - Countries, Locations & Departments. I want to output the country_id and country_name from the countries tables for countries that have no departments. Locations has country_id and location_id columns and departments has location_id and department_id columns. All is in Database 11g. I can produce a table which gives me the locations with departments or without departments as follows:
    select location_id from locations intersect select location_id from departments;
    This gives me a list of locations with departments. Conversely I can get a list of locations without departments as follows:
    select location_id from locations minus select location_id from departments;
    However, to combine this output with the countries table I need to produce country_id in the output. However, when I try to add country_id to my code from above as follows:
    select country_id, location_id from locations intersect select to_char(null), location_id from departments;
    I get no rows found. I understand why. There is no intersection between country_id in locations and the null output from departments (where there is no country_id column). Alternatively, if I try as follow:
    select country_id, location_id from locations minus select to_char(null), location_id from departments;
    I get rows with every country_id whether they have departments or not. Again, I understand why. I am essentially subtracting nothing (the to_char(null) from departments) from the country_id column in locations and getting the entire country_id column as output.
    How can I use set operations to produce the country_id column? I also do not want to show the location_id problem.
    This problem is repeated when I try for the final country_id, country_name final output. The countries table has these columns. However, the locations table does not have the country_name column. It only has the country_id column. So a query such as this one:
    select country_id, country_name from countries intersect country_id, to_char(null) from locations;
    presents me with the same problem as above. The country_id column intersects nicely, but the country_name file does not intersect as it does not exist in the locations table. Again, how can I use set operations to produce the country_id and country_name columns.

    Hi,
    the method I outlined for you above should be fine. It doesn't matter that there are one-to-many relationships which may cause repeated output rows; set operations (except for UNION ALL ) always return distinct rows.
    Can you do a query on the countries table, that shows all countries?
    Can you do a query involving all 3 tables inner-joined, that shows the countries that are related to locations and departments? (Repeated rows are okay.)
    Then you can do a MINUS, to get only the countries that are not related to departments.
    If you get stuck, post a little sample data (CREATE TABLE and INSERT statements), the results you want from tha data, your best attemptat a query, and a description of the problem (including the full error message, if any).

  • Mapping links wont work in Opera and IE but do work in Safari.

    Hi,
    What can I do to fix the code below? The links wont work in IE and Opera, but OK in safari.
    The error message is:
    in tag: map the following required attributes are missing: id[XHTML 1.0 Transitional]
    Code
    <div id="mainContentLeft1b">
    <div id="mainContentArticle2">
    <h3>Locate Region</h3>
    <p>National Contacts</p>
    <img src="Images1/MapAustralia.png" width="600" height="490" alt="stateregion" usemap="stateregion" />
    <map name="stateregion" id="stateregion">
    <area shape="rect" coords="508,282,554,345" alt="NSW" href="http://www.1" />
    <area shape="rect" coords="421,397,506,485" alt="QLD" href="http://www.2" />
    <area shape="rect" coords="233,1,389,163" alt="QLD" href="http://www.3" />
    <area shape="rect" coords="220,179,372,306" alt="NSW" href="http://www.4" />
    <area shape="rect" coords="379,218,597,284" alt="NSW" href="http://www.5" />
    <area shape="rect" coords="458,284,509,325" alt="NSW" href="http://www.6" />
    <area shape="rect" coords="-5,-3,217,227" alt="WA" href="http://www.7" />
    <area shape="rect" coords="353,323,505,371" alt="NSW" href="http://www.8" />
    <area shape="rect" coords="398,16,590,211" alt="NSW" href="http://www.9" /></map>
    </div>
    Thanks
    Karin

    Can we see a URL to your test page where the "links don't work." 
    Unfortunately, code fragments don't help us help you. 
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Oracle 10g - Set Operator Union Causing Timeout Network problem

    Purpose is to get all of the customers not contacted given a starting date and current date(sysdate). The problem is a timeout issue because the query is inefficient. Example: A salesman has 6,946 rows returned from the cust table where his salesid =1163. Then the inner query:
    ‘SELECT count(Customer_ID) FROM cust_info WHERE info_type_id = 32’
    returns 225505 rows just based on this info_type_record.
    Next, ‘SELECT c.customer_id
      FROM customer c,
        event e
      WHERE c.salesperson_id = 1163
      AND e.eventdate BETWEEN '10-Feb-2010' AND TRUNC(SYSDATE)
      AND c.customer_id = e.customer_id
      GROUP BY c.customer_id’
    Returns 231 rows
    Finally, ‘SELECT c.customer_id
      FROM customer c,
        note n
      WHERE c.salesperson_id = 1163
      AND n.created_date_time BETWEEN '10-Feb-2010' AND TRUNC(SYSDATE)
      AND n.note_type_id IN (1,3,4)
      AND c.customer_id   = n.pk_id
      AND n.table_name    = 'CUSTOMER'
      GROUP BY c.customer_id’
    Returns 399 rows.
    How can I improve the structure of this query(see bottom)? The following is a sample data structure:
      CREATE TABLE "CUST "
       (     "CUST_ID" NUMBER,
         "SSN" VARCHAR2(9),
                      "SSN_TYP" NUMBER(1,0),
         "CREATED_DTE_TME" DATE,
         "FULLNAME" VARCHAR2(110),
         "F_NAME" VARCHAR2(35),
         "L_NAME" VARCHAR2(40),
         "BDTE" DATE,
         "DCEASED_DTE" DATE,
         "SALES_ID" NUMBER DEFAULT NULL,
         "BRNCH_ID" NUMBER,
         "HOME_BRNCH_ID" NUMBER,
         "TTL_ASSETS" NUMBER,
         "TTL_ASSETS_DTE" DATE,
         "NO_MAILINGS" NUMBER(1,0),
         "NO_CALLS" NUMBER(1,0) ) ;
      CREATE TABLE "CUST_INFO"
       (     "CUST_INFO_ID" NUMBER,
         "CUST_ID" NUMBER,
         "INFO_TYPE_ID" NUMBER ) ;
    CREATE TABLE "EVENT"
       (     "EVENT_ID" NUMBER,
         "EVENTDATE" DATE,
         "CUST_ID" NUMBER,
         "SALES_ID" NUMBER,     
                      "EVENT_INFO" VARCHAR2(4000)  )
    ENABLE ROW MOVEMENT ;
    CREATE TABLE “NOTE"
       (     "NOTE_ID" NUMBER,
         "NOTE_TYPE_ID" NUMBER DEFAULT 0,
         "TABLE_NAME" VARCHAR2(50),
         "PK_ID" NUMBER,
         "CREATED_DTE_TME" DATE ) ;
    INSERT INTO CUST VALUES(20151,'009529433',1,'01-MAY-5','FRENCH','D','M','01-DEC-01', '05-JUN-05',1163,
    NULL,0,NULL,NULL,NULL,NULL)
    INSERT INTO CUST_INFO VALUES (15,1001,32)
    INSERT INTO EVENT VALUES (5,'05-MAY-05',1001,1163,'NONE')
    INSERT INTO NOTE VALUES (100,2,'CUST',1001,TRUNC(SYSDATE))
    SELECT CUST.CUST_ID,
      SSN,
      F_NAME,
      L_NAME,
      CREATED_DTE_TME ,
      TTL_ASSETS,
      BRNCH_ID,
      SALES_ID ,
      BDTE,
      SSN_TYP,
      FULLNAME,
      Home_BRNCH_ID ,
      No_Mailings,
      No_Calls,
      DCEASED_DTE,
      TTL_ASSETS_DTE
    FROM CUST
    WHERE SALES_ID          = 1163
    AND CUST.CUST_ID NOT IN (
      (SELECT CUST_ID FROM cust_info WHERE info_type_id = 32
    UNION
      (SELECT c.CUST_ID
      FROM CUST c,
        event e
      WHERE c.SALES_ID = 1163
      AND e.eventdate BETWEEN '10-Feb-2010' AND TRUNC(SYSDATE)
      AND c.CUST_ID = e.CUST_ID
      GROUP BY c.CUST_ID
    UNION
      (SELECT c.CUST_ID
      FROM CUST c,
        note n
      WHERE c.SALES_ID = 1163
      AND n.CREATED_DTE_TME BETWEEN '10-Feb-2010' AND TRUNC(SYSDATE)
      AND n.note_type_id IN (1,3,4)
      AND c.CUST_ID   = n.pk_id
      AND n.table_name    = 'CUST'
      GROUP BY c.CUST_ID
    AND CUST.ssn           IS NOT NULL
    AND CUST.DCEASED_DTE IS NULL
    {code}
    Any guidance is appreciated!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    It’s not problem with SET operator. while you are using date field in where clause, U must use date conversion function, otherwise it will stuck there
    Here is the right sql, U can try with this
    SELECT cust.cust_id, ssn, f_name, l_name, created_dte_tme, ttl_assets,
    brnch_id, sales_id, bdte, ssn_typ, fullname, home_brnch_id,
    no_mailings, no_calls, dceased_dte, ttl_assets_dte
    FROM cust
    WHERE sales_id = 1163
    AND cust.cust_id NOT IN (
    (SELECT cust_id
    FROM cust_info
    WHERE info_type_id = 32)
    UNION
    ((SELECT c.cust_id
    FROM cust c, event e
    WHERE c.sales_id = 1163
    AND e.eventdate BETWEEN to_date('10-Feb-2010','dd-mon-rrrr') AND TRUNC (SYSDATE)
    AND c.cust_id = e.cust_id
    GROUP BY c.cust_id)
    UNION
    (SELECT c.cust_id
    FROM cust c, note n
    WHERE c.sales_id = 1163
    AND n.created_dte_tme BETWEEN to_date('10-Feb-2010','dd-mon-rrrr') AND TRUNC
    (SYSDATE)
    AND n.note_type_id IN (1, 3, 4)
    AND c.cust_id = n.pk_id
    AND n.table_name = 'CUST'
    GROUP BY c.cust_id)))
    AND cust.ssn IS NOT NULL
    AND cust.dceased_dte IS NULL;

  • Does EDQ support MINUS set operation

    Hi
    I would like to implement a MINUS set operation using EDQ - is this possible in EDQ?
    For example, I have duplicate records in my input set and I can use the group and merge processor to generate the unique records (btw, it selects the lowest id of the duplicate records) but I want to output all the other duplicated records (that were eliminated as part of group and merge processor) as part of separate output list so some cleanup action  can be taken on those records.
    For eg for following input set:
    id  code
    1   code1
    2   code 1
    3   code 2
    The output of group and merge (merge is done by code) is
    id code
    1  code1
    What I want is to store the following output (that was discarded by group and merge) for cleanup actions later - how I can achieve this using EDQ?
    id code
    2 code1
    Thank you for your time.
    Thanks,
    Priya

    Thanks Mike. Good to know about other configurable options under Merge BUT I'm still not sure how can I get a list of "other" duplicated values - other than the one that is the output of Group and Merge processor.
    Once again, my input data set is something like
    <id>  <code>
    1       code1
    2       code 1
    3       code 2
    The output of group and merge (merge is done by code and it uses the default to select the lowest id or first one available) is
    <id> <code>
    1      code1
    (The above default behavior for the Group and merge is fine for our example.
    BUT, What I want is to store the following output (that was discarded by group and merge) for cleanup actions later - how I can achieve this using EDQ?
    <id> <code>
    2      code1
    (As you notice, code1 is duplicated twice in the input data set and I want to write to the output the other record - meaning id=2 in the above example)
    Thanks,
    Priya

  • Use boolean array to perform set operations

    I am currently taking a computer science class that uses Java as the language of choice. I have no prior experience with Java. We have a homework assignment in which we are supposed to use a boolean array to implement set operations. We have to create a method that inserts an integer into the array, another that deletes an integer element, and several others. I am confused as how to do this with integers, as it is a boolean array. The datr for this class is:
    private boolean base[];The constructor is:
    public largeset(int size){ }We then have to create a method that inserts an integer into the array:
    public void insert(int i){ }And one that deletes the element:
    public void delete(int i) { }I am unsure how to do this using a boolean array. If it were an integer array I would not have any trouble, but I get an error when trying to insert/delete an integer from the boolean array. Can anyone help point me in the right direction? I would prefer advice only, not the actual code, as this is a homework assignment, and I would like to create the code myself so I actually know what I am doing. Thanks.

    This is the assignment exactly as posted on the course website:
    In this homework, we will use a boolean array to implement various set operations. Please create a class called largeset that supports set operations of any number of elements. The data of this class is
    private boolean[] base;The constructor of the class is
    public largeset(int size);  // create a boolean array of size "size" and store it in "base"The methods of the class are:
    public void insert(int i);  // insert number i into the current set, where 0 <= i < base.length
    public void delete(int i);  // delete number i from the current set, where 0 <= i < base.length
    public boolean member(int i); // test if i is in the set
    public largeset union(largeset B); // return the union of two sets
    public largeset interset(largeset B); // return the intersection of two sets
    public largeset subtract(largeset B); // return the subtraction of two sets
    public largeset complement(); // return the complement of the current set
    public boolean subset(largeset B); // test if the current set is a subset of set B
    public int cardinality();  // return the number of elements in the current set
    public String toString();  // return a string which is a printing of the current setThen create another class called testset that uses the largeset class. At first, please create the following two sets:
    X = { 1, 3, 5, 7, ..., 999 };
    Y = { 9, 18, 27, 36, ..., 999 };
    Please perform the following tests:
    1. display the cardinalities of X and Y, respectively.
    2. display the content of substraction of Y by X.
    3. display the square root of the sum of all the elements of X (Math.sqrt(x) will return the square root of x in double type).
    4. For every pair of distinct elements x and y in Y, compute the sum of (Math.max(x, y) - Math.min(x, y)) (or equivalently, Math.abs(x - y)), and report this sum.

  • LabVIEW and Set Operations

    Hello all,
    I am a student at the University of Texas @ Austin and I have been
    looking through the LV 5.0 documentation for any documentation about
    Sets and/or Operations on Sets but cannot find anything usefull. Does
    anyone know if LV supports Sets and operations on Sets, for example,
    Union, Intersection, or just a way to specify the elements of a Set? I
    have an assignment to create a Non-Deterministic Finite State Machine
    Simulator and would like to implement it using LV? I have some ideas on
    how to Fake the set operations but it would be much easier to not have
    to re-invent the wheel. I will check the newsgroup, but please also
    respond to [email protected]
    Thanx in advance Jeffo ....

    "Jeffrey R. Orbach" wrote:
    > Does anyone know if LV supports Sets and operations on Sets, for example,
    >
    > Union, Intersection, or just a way to specify the elements of a Set?
    There are probably a number of ways to implement this in LabVIEW, depending
    upon what kind of data you want in your sets, what kind of operations you
    want to perform on them, etc. It's a pretty open-ended question without
    more detailed knowledge of what you're after.
    From my point of view, the LabVIEW array structure and its operators are a
    construct that provides some set-like functionality right away:
    specify set elements => array control on panel
    check for membership => Search 1D Array
    set union => Build Array (followed by Sort 1D Array if you want to keep the
    set sorted)
    set intersection
    => loop through one array using Search 1D Array on the
    other to generate output set
    This is one simple approach that shouldn't require a whole lot of coding or
    wheel reinvention...
    Regards,
    John Lum
    National Instruments

  • SWIM5004: Cannot initiate SNMP-set operation

    Hi,
    i am trying to get the IOS images for 6509, 6504 vss and 4506-E through LMS 3.2.1.
    i have configured RO SNMP v3 and i am encountring with the following error:
    """  Importing the image s72033-ipservicesk9_wan-vz.122-33.SXI5.bin from the device sup-bootdisk into the Software Repository.
    Image will be copied to rep_sw_8156213553784565916 using TFTP.
    Could not import s72033-ipservicesk9_wan-vz.122-33.SXI5.bin from the device.
    Error Message:
    SWIM1124: Failed to copy the image from Flash due to the reason - SWIM5004: Cannot initiate SNMP-set operation.
    The SNMP Write Community String might be wrong.
    Check whether the correct SNMP Write Community String is entered in Device and Credential Repository..
    Retry the operation. If the problem persists, check the Bug Toolkit application for any known issues on the running image version.
    Image Import Operation Failed
    Device is unlocked.
    Device Import Result : Failed
    End Time:Sat Jul 30 10:44:38 GMT+03:00 2011
    SWIM0036: Could not add this image to software repository.  """
    i successfully imported 3560 switches to the depository but not able for 4500 and 6500 series where all the settings are the same.
    Kindly if anyone can help.
    Regards,
    George

    Hi Joel,
    First of all i would like to thanks your answer.
    The Check Device Credential shows the snmp communities rw was false.
    I changed the communities so i clicked to device credentials button on  the Device Credentials Verification Job Details form.
    The softver upload is working right now from this device.
    Earlier i tried to run the management station to devices function and it was succcessful for SNMP RW!!!!!!!!!!!!!!!!!!!!!!!!!!!
    I tried to change the commnities via CS > Device and Credentials > Device Management.
    Despit all these the RME fetching was not working.
    I do not unterstand what is the different .
    Regards

  • Handy way to order columns in SET operator ?

    Not only this operator can be one of the most loaded with numerous columns but every group has to be ordered the same way and I can't find any tool/menu to swap two columns (as an instance)
    Do you know any other simpler way to do that rather than costingly emptying every single set to refill them in the right order one-by-one ?
    Thanks

    Basically the fastest way would be using OMBPLUS, first create the SET operator and next add columns in the desired order.
    Another option is the OWB Client itself, but only if the order of the columns is the same as that of some table (maybe the target table for the SET operator?).
    Get that table into the mapping, and use it as source for the columns of the SET operator. Next delete that table from the mapping an connect the columns in the SET operator with their desired sources.
    I guess you could even define a 'dummy' table for that in OWB if you need to use it more often, if you set Deployable to FALSE you won't even have to bother about seeing it deployed to your target schema.
    Hope this helps.
    Cheers, Patrick

  • Set operations in AdHoc Query - user settings

    Hi
    I am checking out the Set operations in AdHoc Query.  The documentation says you should save the setting "Set operations shown" as a user setting.  Could anyone advise me where this is set?  I can't find a parameter for it, and can't find it in the regular settings.
    Any help appreciated.
    Kirsten

    The save is automatic upon exiting Ad Hoc query.  Once you do "Show Set Operations", work on a query, save and exit, the next time you open Ad Hoc query, Set Operations tab is displayed by default.
    Regards,
    RN.

  • Mapping the Follow-up action to the Usage-Decision

    Hi All,
               I have a the following requirement in my development:
    The Usage decision needs three function-modules for the three cases of the follow-up process.
    In addition to that this ,service shall have a control table in Customizing, where the customer is able to decide which follow-up action should be made. (not standard customzing). The function-module for this process is not standard.
    1) Does the second requirement also require FM?
    2) Please give me the steps to map the Follow-up action to the Usage-Decision in SPRO
    Thanks,
    Vasuki

    Hi
    First create the follow up action which you want, and assign the same in QS51 t.code to your UD code group.
    Thanks
    S.Murali

  • I bought a brand new mac and follow through setting up process with my apple id but when I open App Store I don't see lion into the purchases list. why?

    I bought a brand new mac and follow through setting up process with my apple id but when I open App Store I don't see lion into the purchases list. why?

    Updates come through Software Update not the App Store. If you have to reinstall Lion that is done via Internet Recovery.
    OS X Lion- About Lion Recovery
    OS X Lion- Run Software Update to use Lion Internet Recovery
    Lion maintenance and recovery operate via the Recovery HD. It's possible to create a separate recovery disk on a flash drive using OS X Lion: About Lion Recovery Disk Assistant.
    To boot into the Recovery HD:
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.

  • AdHoc Set Query - set operations - practical use

    Hi
    I am writing a user manual about AdHoc Query - including Set operations. I am looking for good examples when to use the different operations.  A-B is easy.  Example - 'give me all employees that are not on maternity leave'.  But I am struggling with good practical examples on when to use Union and Intersection.  It needs to be examples that cannot be covered by selection criteria in one single query.
    Does anyone have any good practical examples?  Any help appreciated.
    Kirsten

    Hi Kirsten,
    I use Set Operations many times to find individuals who do not have a certain infotype or plan.  Example:  Find all retirees who are not enrolled in a medical plan.  Group A = All retirees;
    Group B = All retirees in a medical plan.  A - B = Retirees with no medical plan coverage. 
    Ad Hoc Query does not allow you to use "Or" logic in selection with different criteria.  A Union could be used for this.  An example would be employees who are in pay Grade 1 - 5 (Group A) or earn less than $50,000 per year (Group B).  Intersection would be those in Grades 1 - 5 and earn less than $50,000 per year. 
    Paul

Maybe you are looking for

  • IPhone World Clock doesn't show the correct times

    How do I get the iPhone to show the correct World Clock times. I have the time zone set to San Diego and the clock time is correct. When I set San Diego as one of the World Clock times it shows a time 7 hours behind. New York is 4 hours behind instea

  • TS3623 Rented iTunes movie not loading.

    I have a new apple tv device. I rented a movie through iTunes however every time I go to watch it, I'm told there are xx number of minutes left to load. This number changes every time I check it but it is never fully loaded. The device is connected w

  • Maps zoom/scroll with Magic Mouse

    Hi In Maps.app, scrolling over the map with magic mouse, moving the map instead of zooming, i need to press SHIFT when i need zoom in or out. Other apps (google maps in safari, or google earth.app) working with zoom set as default.  How can i change

  • Analysing data on text files

    I am very new to learning java and I am trying to find out how I can assign data on a text file to variables for me to analyse, but I'm not sure how to do it. I know how too read in each line of the file, but I'm not sure how to assign each of the nu

  • How do I keep Bonjour IDs separate on 2 Macs that share a common iCloud ID?

    I have two iMacs that share a common iCloud ID so they can exchange contacts, calendars, etc. The problem is that when I use Messages, both Macs use the same name since they both have the admin user with the same Apple ID. How do I share the same iCl