Compare operator

I am trying to compare two operators.
The operators are: + - * / ^
They have all different priority
^ = 3
* = 2
/ = 2
+ = 1
- = 1
How can I compare a character '*' with
a character '+' of which one has the
highest priority?

I thought this really would work, but
surely I have missed something.
This is my code:
import java.util.*;
import javax.swing.*;
public class InfixToPostfix {
     public static void main(String[] args) {
          Object slutt            = "#";
          String infixStr      = JOptionPane.showInputDialog("Tast inn infix-uttrykket: ");
          infixStr              += slutt;
          String postfixStr     = "";
          System.out.println("Infix: "+infixStr);
          Stack stack = new Stack();
          stack.add(slutt);
          System.out.println ("Stack is empty: "+stack.empty ()+ ", Stack: " + stack);
          Map <String, Integer> priorities = new HashMap<String, Integer>();
          priorities.put("^", 3);
          priorities.put("*", 2);
          priorities.put("*", 2);
          priorities.put("+", 1);
          priorities.put("-", 1);
          priorities.put("#", 0);
          //String op = "+";
          Object c;
          String stackOp;
          String infixOp;
          int infixPri;
          int stackPri;
          for (int i=0; i<infixStr.length(); i++) {
               c = infixStr.charAt(i);
               infixOp= c.toString();
               infixPri = priorities.get(infixOp);
               System.out.println("A: "+infixPri+infixOp);
               if (infixOp == "+" || infixOp == "-" || infixOp == "*" || infixOp == "/" || infixOp == "^") {
                    if (stack.empty()) {
                         stack.push(String.valueOf(c));
                    else {
                         while (!stack.empty()) {
                              stackOp = (String) stack.pop();
                              stackPri = priorities.get(stackOp);
                              if (stackPri >= infixPri) {
                                   postfixStr += stackOp;
                              else stack.push(String.valueOf(c));
               else if (c == "#") {
                    System.out.println("Postfix: "+ postfixStr);
                    System.exit(0);
               else {
                    postfixStr += c;
}At these lines: "stack.push(String.valueOf(c));"
I get this message -->
Type safety: The method push(Object) belongs to the raw type Stack. References to generic type
Stack<E> should be parameterized

Similar Messages

  • Compare Operation

    Hello,
    i want to build a compare operation based on the DSP48 MACRO. The comparison is between two values one which is dynamic. At the end i want to feed a counter(which will be generated by a binary counter based on dsp slices) to the dsp macro and compare with a predefined value. In the IP Catalog selecting DSP48 Macro offers different instruction. Accoring to a xilinx user guide the  comparator implementation is done by substraction and using Pattern Detector. But in the IP configuration GUI there is no Pattern Detector option.
    Kintex7 - Vivado 2015.1
    binary_counter_module_output  ->|                           |
                                                                   | DSP48 Macro |-> match
                           predefined_pattern -> |                           |
    Thanks

    Thanks.
    Last time i implemented the comparison with the EQ_COMPARE_MACRO (in the template window of vivado). But the simulation result were quite strange. On its DATA_IN port i provided a constant value while on the DYNAMIC_PATTERN input i fed the output of a binary counter module. In the simulation the output Q asserted two times. The first when the match happens and the second one after two clcok cycles even when a match did not happen.
    Do you have an idea what i have to consider when using the macro. 

  • I can't seem to get individual elements when comparing 2 arrays using Compare-Object

    My backup software keeps track of servers with issues using a 30 day rolling log, which it emails to me once a week in CSV format. What I want to do is create a master list of servers, then compare that master list against the new weekly lists to identify
    servers that are not in the master list, and vice versa. That way I know what servers are new problem and which ones are pre-existing and which ones dropped off the master list. At the bottom is the entire code for the project. I know it's a bit much
    but I want to provide all the information, hopefully making it easier for you to help me :)
    Right now the part I am working on is in the Compare-NewAgainstMaster function, beginning on line 93. After putting one more (fake) server in the master file, the output I get looks like this
    Total entries (arrMasterServers): 245
    Total entries (arrNewServers): 244
    Comparing new against master
    There are 1 differences.
    InputObject SideIndicator
    @{Agent= Virtual Server in vCenterServer; Backupse... <=
    What I am trying to get is just the name of the server, which should be $arrDifferent[0] or possibly $arrDifferent.Client. Once I have the name(s) of the servers that are different, then I can do stuff with that. So either I am not accessing the array
    right, building the array right, or using Compare-Object correctly.
    Thank you!
    Sample opening lines from the report
    " CommCells > myComCellServer (Reports) >"
    " myComCellServer -"
    " 30 day SLA"
    CommCell Details
    " Client"," Agent"," Instance"," Backupset"," Subclient"," Reason"," Last Job Id"," Last Job End"," Last Job Status"
    " myServerA"," vCenterServer"," VMware"," defaultBackupSet"," default"," No Job within SLA Period"," 496223"," Nov 17, 2014"," Killed"
    " myServerB"," Oracle Database"," myDataBase"," default"," default"," No Job within SLA Period"," 0"," N/A"," N/A"
    Entire script
    # things to add
    # what date was server entered in list
    # how many days has server been on list
    # add temp.status = pre-existing, new, removed from list
    # copy sla_master before making changes. Copy to archive folder, automate rolling 90 days?
    ## 20150114 Created script ##
    #declare global variables
    $global:arrNewServers = @()
    $global:arrMasterServers = @()
    $global:countNewServers = 1
    function Get-NewServers
    Param($path)
    Write-Host "Since we're skipping the 1st 6 lines, create test to check for opening lines of report from CommVault."
    write-host "If not original report, break out of script"
    Write-Host ""
    #skip 5 to include headers, 6 for no headers
    (Get-Content -path $path | Select-Object -Skip 6) | Set-Content $path
    $sourceNewServers = get-content -path $path
    $global:countNewServers = 1
    foreach ($line in $sourceNewServers)
    #declare array to hold object temporarily
    $temp = @{}
    $tempLine = $line.Split(",")
    #get and assign values
    $temp.Client = $tempLine[0].Substring(2, $tempLine[0].Length-3)
    $temp.Agent = $tempLine[1].Substring(2, $tempLine[1].Length-3)
    $temp.Backupset = $tempLine[3].Substring(2, $tempLine[3].Length-3)
    $temp.Reason = $tempLine[5].Substring(2, $tempLine[5].Length-3)
    #write temp object to array
    $global:arrNewServers += New-Object -TypeName psobject -Property $temp
    #increment counter
    $global:countNewServers ++
    Write-Host ""
    $exportYN = Read-Host "Do you want to export new servers to new master list?"
    $exportYN = $exportYN.ToUpper()
    if ($exportYN -eq "Y")
    $exportPath = Read-Host "Enter full path to export to"
    Write-Host "Exporting to $($exportPath)"
    foreach ($server in $arrNewServers)
    $newtext = $Server.Client + ", " + $Server.Agent + ", " + $Server.Backupset + ", " + $Server.Reason
    Add-Content -Path $exportPath -Value $newtext
    function Get-MasterServers
    Param($path)
    $sourceMaster = get-content -path $path
    $global:countMasterServers = 1
    foreach ($line in $sourceMaster)
    #declare array to hold object temporarily
    $temp = @{}
    $tempLine = $line.Split(",")
    #get and assign values
    $temp.Client = $tempLine[0]
    $temp.Agent = $tempLine[1]
    $temp.Backupset = $tempLine[2]
    $temp.Reason = $tempLine[3]
    #write temp object to array
    $global:arrMasterServers += New-Object -TypeName psobject -Property $temp
    #increment counter
    $global:countMasterServers ++
    function Compare-NewAgainstMaster
    Write-Host "Total entries (arrMasterServers): $($countMasterServers)"
    Write-Host "Total entries (arrNewServers): $($countNewServers)"
    Write-Host "Comparing new against master"
    #Compare-Object $arrMasterServers $arrNewServers
    $arrDifferent = @(Compare-Object $arrMasterServers $arrNewServers)
    Write-Host "There are $($arrDifferent.Count) differences."
    foreach ($item in $arrDifferent)
    $item
    ## BEGIN CODE ##
    cls
    $getMasterServersYN = Read-Host "Do you want to get master servers?"
    $getMasterServersYN = $getMasterServersYN.ToUpper()
    if ($getMasterServersYN -eq "Y")
    $filePathMaster = Read-Host "Enter full path and file name to master server list"
    $temp = Test-Path $filePathMaster
    if ($temp -eq $false)
    Read-Host "File not found ($($filePathMaster)), press any key to exit script"
    exit
    Get-MasterServers -path $filePathMaster
    $getNewServersYN = Read-Host "Do you want to get new servers?"
    $getNewServersYN = $getNewServersYN.ToUpper()
    if ($getNewServersYN -eq "Y")
    $filePathNewServers = Read-Host "Enter full path and file name to new server list"
    $temp = Test-Path $filePathNewServers
    if ($temp -eq $false)
    Read-Host "File not found ($($filePath)), press any key to exit script"
    exit
    Get-NewServers -path $filePathNewServers
    #$global:arrNewServers | format-table client, agent, backupset, reason -AutoSize
    #Write-Host ""
    #Write-Host "Total entries (arrNewServers): $($countNewServers)"
    #Write-Host ""
    #$global:arrMasterServers | format-table client, agent, backupset, reason -AutoSize
    #Write-Host ""
    #Write-Host "Total entries (arrMasterServers): $($countMasterServers)"
    #Write-Host ""
    Compare-NewAgainstMaster

    do not do this:
    $arrDifferent = @(Compare-Object $arrMasterServers $arrNewServers)
    Try this:
    $arrDifferent = Compare-Object $arrMasterServers $arrNewServers -PassThru
    ¯\_(ツ)_/¯
    This is what made the difference. I guess you don't have to declare arrDifferent as an array, it is automatically created as an array when Compare-Object runs and fills it with the results of the compare operation. I'll look at that "pass thru" option
    in a little more detail. Thank you very much!
    Yes - this is the way PowerShell works.  You do not need to write so much code once you understand what PS can and is doing.
    ¯\_(ツ)_/¯

  • Request: compare and propagate user objects

    After making changes to table definitions, views, program units, and so on, it may be useful to propagate these changes to another database user. This maybe another development environment, or a testing environment in same or another database. Like "Compare user objects" option in PLSQL/Developer.
    /* BEGIN: cut and paste from PLSQL Developer Help */
    Compare User Objects
    After making changes to table definitions, views, program units, and so on, it may be useful to propagate these changes to another database user. This maybe another development environment, or a testing environment. To compare the objects of your development user with another user, you can use the Compare User Objects function in the Tools menu. This will bring up the following dialog:
    On the Selection tab page you can select the objects you wish to compare. After making this selection, you can press the Target Session button, to select the user and database that you want to compare. This will enable the Compare button, which you can press to start the compare operation. You can select the Include storage... option to include the storage information such as tablespace names and initial sizes for new objects. These may differ across databases, so this may not always be appropriate.
    When the compare operation is finished, the dialog will switch to the Differences tab page, which will show a list of all objects that are different:
    This list is sorted in order of dependency. Below the list of different objects of the target user, you see the SQL that needs to be executed to make these objects equal to the corresponding objects of the current user. If no object is selected, the SQL of all objects is displayed. If one or more objects are selected, only the SQL for the selected object(s) is displayed. In the example above, a missing EMP_MGR_EMPNO check constraint was added to the EMP table.
    The Show Differences button will show a visual line-by-line difference of the old and new source file of an object. This can be useful to view the changes made in Program Units, or can help you determine why a specific DDL statement was generated for other object types. The Configure External Difference Tool allows you to configure the difference tool should be used. By default the ExamDiff utility will be used, for which a Pro version is available (See the About item of ExamDiff’s Info menu). See also Tools - Differences.
    You can now press the Apply SQL button to execute this SQL in the target session. You can alternatively save the SQL in a file by pressing the Save SQL button, or you can copy it to the clipboard by pressing the Copy SQL button.
    When objects are compared, the following properties are ignored:
    ·     Storage – Properties such as the next extent and pct free of tables and indexes are not considered relevant for comparison.
    ·     Constraints with system generated names – These constraints will have different names for the 2 users, so they cannot be compared. If a table is new in the target session, these constraints will be generated though.
    ·     Table creation properties – Properties that would require the recreation of the table are ignored.
    ·     Table data – To export table data, use the Export Table function (see Export Tables).
    ·     Sequence values – The current value of a sequence is considered data.
    /* END: cut and paste from PLSQL Developer Help */

    This is on the list but not for 1.0.
    -kris

  • Hardware compare issue - PXI-6552

    Hi!
    I'm using a PXI-6552 DIO module for testing SDRAM chip.
    I'm not sure about hardware compare operating. I'm using a sequence of 0 and 1 to drive the tester during write command and H/L as expected responde with read command.
    Does the H/L response data puts the driver to high impedance?
    The problem is that also when i skip the write command I retreive (fetch) the response data correctly.
    Thank you!
    MM

    Thank you for the answer!
    My configuration is a little bit different because I use the D0..D7 lines as bidirectionl lines.
    I noted that the system works while the clock frequency is below 25 MHz, but i don't know why.
    Has anyone tried to use this module above 25MHz?
    Thanks a lot!
    MM

  • Compare binary file

    Hi,
    I am using LV 8.5.1. Would like to know, is there any method can compare 2 binary files? Same function as command prompt below:
    fc /b "file 1 path" "file 2 path"
    First do not consider use the system exec.vi.
    Appreciate your feedback.
    Thanks.
    Solved!
    Go to Solution.

    Doing it in LabVIEW is fraught with all sorts of issues that the fc command has probably already addressed.  But if you want to do it, I would recommend the following:
    Read your file in 65,000 byte chunks to optimize disk I/O.
    Compare each chunk.  Your compare operation is up to you.  Note that depending on how you want to compare, you may want to do this byte by byte or chunk by chunk to find the locations of differences, but also find locations which equal, even if they have different offsets (e.g. a difference is a single byte inserted into the file).
    Output your results.  The output is also up to you.  It could be a file, a front panel indicator, the operating system error buffer, etc.
    All in all, this is a lot of work vs. just using the fc command.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Compare in JNDI

    A compare operation in JNDI is different from LDAP. Which is more efficient and why?

    The general process I've always used is:
    A) Lookup up users DN (usually searching on cn) anonymously
    B) Reconnect to the LDAP server as that user (DN + password)
    if the password is correct, you'll get no errors
    if it's incorrect, you'll get an AuthenticationException (invalid credentials)
    Password fields seem to be write-only as far as searching goes. (depends on LDAP implementation, I'm sure) This is most likely to help prevent brute force password cracking. We use Novell's eDirectory here. I can set the password using plain text, but cannot read or compare. The above mentioned process works fine though.

  • Comparing workareas excluding some specific fields

    Hi all gurus,
    a silly question, I know, anyway: in my requirement I have to compare different workareas in a loop cycle with a model workarea. The aim is to identify if a workarea in a loop differs from the model workarea except for some specific fields.
    In example; the workarea A has 100 fields, and I assume that this workarea is equal to the model one (B)  if all the fields in A contain the same value that corrisponding field have in B except for fields 'guid' and 'p_guid', which can contain different values.
    So, A is EQ to B if the other 98 fields are filled with the same values.
    Actually I can build a sequence of comparing condition:
    IF A-field1 EQ B-field1 AND A-field2 EQ B-field2 ...
    that's quite time-wasting and I wonder if there's a better solution to compare in the above described way.... a sort of exclusion for the compare operation maybe?
    Sorry, I get that this is probably a very basic question, anyway I searched a bit without results.
    Thanks in advance.

    If you could change the definition of data type then this comparision can be done in single statement.
    See example below.
    TYPES : BEGIN OF ty_d ,
              col01 TYPE char01 ,
              col02 TYPE char01 ,
              col98 TYPE char01 ,
            END OF ty_d .
    TYPES : BEGIN OF ty_dd .
    INCLUDE TYPE ty_d AS d .    "this will enable to refer all COL01.. COL98 by name 'd'
    TYPES : guiid TYPE char05 ,
    END OF ty_dd .
    DATA : ls_dd1 TYPE ty_dd ,
           ls_dd2 TYPE ty_dd .
    ls_dd1-col01 = 'A' .
    ls_dd1-col02 = 'B' .
    ls_dd1-col98 = 'C' .
    ls_dd2-col01 = 'A' .
    ls_dd2-col02 = 'B' .
    ls_dd2-col98 = 'C' .
    IF ls_dd1-d = ls_dd2-d .
      WRITE 'EQUAL' .
    ELSE.
      WRITE 'NOT EQUAL'.
    ENDIF.
    ls_dd2-col01 = 'D' .
    IF ls_dd1-d = ls_dd2-d .
      WRITE / 'EQUAL' .
    ELSE.
      WRITE / 'NOT EQUAL'.
    ENDIF.

  • JDBC Receiver Adapter -- Synch Select. ERROR

    Hello,
    We have implemented the scenario described by Bhavesh Kantilal in blog 3928:
    JDBC Receiver Adapter -- Synchronous Select – Step by Step 
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    but modified to our requirements.
    An Idoc is coming in, mapped to a sync receiver jdbc as described to collect data from a jdbc table.
    Result when connecting the oracle database with the jdbc receiver adapter:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'T_ST_MAINDRIVER' (structure 'STATEMENT'): java.sql.SQLException: ORA-00942: table or view does not exist
    Oh, like to complete the information by the payload from the jdbc rec. connect:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_JDBC_LOOPUP_ID xmlns:ns0="http://www.xxx.org/excel">
    - <STATEMENT>
    - <TABLENAME ACTION="SELECT">
      <TABLE>T_ST_MAINDRIVER</TABLE>
      <ACCESS />
    - <KEY>
      <MAINDRIVER compareOperation="=">Optomechanical</MAINDRIVER>
      </KEY>
      </TABLENAME>
      </STATEMENT>
      </ns0:MT_JDBC_LOOPUP_ID>
    The table exists on the database. So, what is our mistake? Do you have any ideas?
    Best regards
    Dirk
    Message was edited by:
            Dirk Meinhard
    Message was edited by:
            Dirk Meinhard

    Hi Anil,
    I am back on my JDBC problem and I am one step further!
    Thank you for this hint. Looks like this is the solution.
    So I like to add my next question !
    My new error is resulting from my query command.
    I have set "=" to find a specific entry as compare operation.
    Error when executing statement for table/stored proc. 'IRIS.T_ST_MAINDRIVER' (structure 'STATEMENT'): java.sql.SQLException: FATAL ERROR document format in structure 'TABLENAME': unexpected value '=' for attribute 'compare' found
    Looks like this is not ok .
    This is my xml of this query:
    <ns0:MT_JDBC_LOOPUP_ID xmlns:ns0="http://www.xxx.org/excel">
       <STATEMENT>
          <TABLENAME ACTION="SELECT">
             <TABLE>IRIS.T_ST_MAINDRIVER</TABLE>
             <ACCESS/>
             <KEY>
                <MAINDRIVER compareOperation="=">Optomechanical</MAINDRIVER>
             </KEY>
          </TABLENAME>
       </STATEMENT>
    </ns0:MT_JDBC_LOOPUP_ID>
    Can you, or anybody else, give the helping idea?
    regards
    Dirk

  • AD external auth. plug-in

    Hi.
    I have synchronization working fine from AD to OID. I have also followed instructions to install and enable the plug-ins. However, when I try to login to sso as an AD user, the login fails with ldap error 16-no such attribute.
    I believe it is not possible to synchronize AD passwords into OID, so, of course the attribute is not there for the AD users.
    I think the problem is: The plug-in is not actually getting called. I turned on tracing for the compare operation, and I do not see any errors.
    Has anyone had any success using the plug-ins?
    This is 10g on Windows2003.
    Thanks!

    Actually, I have it working. Just had to keep working at it ;)

  • Explain Plan results analysis

    I have EXPLAIN PLAN results for some SELECT queries. What is the difference between INDEX UNIQUE SCAN and INDEX RANGE SCAN?

    btw it depend not only of your compare operation
    but also on index type. See difference for equality between simple index and unique index:
    SQL> desc a
    Name                                      Null?    Type
    A                                                  NUMBER
    SQL> create index aidx on a (a);
    Index created.
    SQL> set autot traceonly explain
    SQL> select * from a where a = 1;
    Execution Plan
    Plan hash value: 3649445643
    | Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |      |     1 |    13 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX RANGE SCAN| AIDX |     1 |    13 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("A"=1)
    SQL> drop index aidx;
    Index dropped.
    SQL> create unique index aidx on a (a);
    Index created.
    SQL> select * from a where a = 1;
    Execution Plan
    Plan hash value: 2717653437
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |    13 |     0   (0)| 00:00:01 |
    |*  1 |  INDEX UNIQUE SCAN| AIDX |     1 |    13 |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("A"=1)
    SQL> Of course even with unique index >, <, between will have range scan:
    SQL> select * from a where a>1;
    Execution Plan
    Plan hash value: 3649445643
    | Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |      |     1 |    13 |     0   (0)| 00:00:01 |
    |*  1 |  INDEX RANGE SCAN| AIDX |     1 |    13 |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("A">1)
    SQL> In general index range scan might expect back more than 1 row, while index unique scan usually expect 1 row, however of course in both cases you might get zero rows back.
    See my blog entry Where bad performance starts at http://gplivna.blogspot.com/2007/03/where-bad-performance-starts-my.html
    it has many links aboput b-tree index internals, I'm quite sure some of them explained these operations more as well.
    Gints Plivna
    http://www.gplivna.eu

  • SUN DSEE 6.2 vs Fedora DS 1.1 performance comparison

    Hi all,
    I've just discovered a nice tool from SUN about performance analysis for ldap servers named SLAMD (http://www.slamd.com)
    So I configured it and tried to analyze my servers. I've setup one SUN DSEE 6.2 and one Fedora DS 1.1
    in my workstation. Both of them being populated with the same data (160 sample entries from sun) and using the same file descriptors.
    My workstation is running fedora 8, Core(TM)2 Duo CPU E6550 @ 2.33GHz / 2 GB ram.
    I did a couple of tests but all of them had the same search filters
    Entry DN           ou=people,dc=example,dc=com
    Search Filter           objectClass=*
    Attribute(s) to Compare/Modify      Add Operation Frequency           3
    Compare Operation Frequency           7
    Delete Operation Frequency           4
    Modify Operation Frequency           4
    Modify RDN Operation Frequency           1
    Search Operation Frequency           10      description
    I will give the results of my final test which lasted 240 seconds / 200 threads from one client
    DS Overall Operations (Average/sec)
    SUN *35,858*
    Fedora *304,867*
    It seems to me there is a huge difference! I didn't expect to get such numbers. To tell you the truth
    I expected SUN DS to be much faster that Fedora DS instead of being *10 times slower*.
    Furthermore while running the test on the Fedora DS the system got a max load of around 7-8 which implied that the system
    worked hard to perform the test (CPU always at 100%).
    On the other hand while running the SUN DS test, the system never got load more that 1 (cpu not more that 22%).
    It was like the SUN DS was capable to do better but it was never bothered. I played with indexes, file descriptors, number of threads without
    any significant change of performance.
    I'm sure SUN DS can do better. So I'm looking for thoughts on the subject as well as performance tunning/optimization documentation.
    Is the resource kit also available for 6.2 or is it just for SUN ONE server?
    regards
    Giannis

    Giannis,
    Giving raw performance numbers doesn't mean anything unless you also provide the details of the data in your directory server, the settings and the exact tests performed (if it's a slamd standard job, give its name).
    Slamd contains many jobs that are doing many different things leading to completely different numbers in term of operations per second.
    This said, the numbers you show are puzzling me : SUN 35,858 vs Fedora 304,867 (Operations / Second) ?
    I assume the , is the unit separator (and not like in the US the separator between thousands and hundreds).
    If so, there is definitely something badly configured on Sun DS and/or Slamd.
    Regards,
    Ludovic.

  • One File Adapter, many xml types

    Hi,
    I have to use file sender adapter to read files from a directory.  The files are in XML format. Each file has a different XML structure and I can not distinguish by the name file the type of XML that goes into the file. How can I do that ?.
    Thanks.
    Best regards

    Hi Francisco,
    hopefully you solved the issue already, but maybe someone else has the same issue.
    I just faced the same challenge.
    In my scenario the all message types have the same receiver but different inbound interfaces and mappings should be used.
    I solved it by checking the root element with a xpath content based routing in the interface determination.
    It's important that you register the different namespaces used by the message types and then just insert the root element name and as compare operation select EX
    In my sample I have to deal with two message types which use different namespaces.
    message type1 eCH-0020:delivery xmlns:eCH-0020="http://www.ech.ch/xmlns/eCH-0020/2"
    message type2 eCH-0078:eventReport xmlns:eCH-0078="http://www.ech.ch/xmlns/eCH-0078/2"
    Therfore I inserted both namespaces in the table of the expression editor
    prefix eCH-0020     namespace http://www.ech.ch/xmlns/eCH-0020/2
    prefix eCH-0078     namespace http://www.ech.ch/xmlns/eCH-0078/
    the value of the prefix is up to you, I decided to use descriptive namespaces
    and then insert follwing XPATH expressions
    /eCH-0078:eventReport  EX
    /eCH-0020:delivery EX
    that's it
    hope this helps.
    Best regards,
    Jochen

  • Quick advice needed on Observer and Observable...

    Ok at the moment i have about 10 sorting algorithms in 10 classes. They all extend another class which includes methods like print, randomise, user input etc etc which all sorting classes use. So basically my sorting classes only sort and nothing more is done in those classes.
    Now what i want to do is have some statistics on a GUI. This will include copy coperations, compare operations and total operations. I will obviously need to input where these operations occur for each sorting class. I want the GUI to be updated each time an operation happens. All my sorts run in a thread, i did this so i can choose the speed of the sort with a JSlider.
    My question is, will i need to be using the Observer and Observable interface? If so, can i have some advice into how i would structure this. If not, then how else can i do a statistics class. I tried a way without this approach, but it didn't seem too OO friendly. Any help is appreciated.
    Thanks in advance.

    I'm not a GUI guy and this is definitely not the best way to do it - but you could probably call an update method after each calculation or whatever. Make a static method that has a reference to your GUI form.
    This is definitely not an elegant solution - but I think it's explicit and readable, and that can be more valuable than elegance.

  • System load application (stress measurement)

    Hi,
    I am about to create a Benchmark application. The main purpose of the application is to compare performance between Linux and Windows NT. Two PCs equipped with Gigabit Ethernet cards are to be connected point-to-point.
    (*PC, Sender*)---->UDP/TCP channel---->(*PC, Receiver)
    One PC will load the other PC by sending either TCP or UDP packets. I have already written both receiver and sender applications, but I need to monitor the system load at the receiving end. My question is whether it is possible to perform the following actions with Java code.
    * Measure the CPU usage on the receiving PC.
    * Monitor the level of PCI bus traffic.
    * I want to monitor the memory load. (more precise than freeMemory() and totalMemory() )
    If any of these options are possible, where can I find more info/sample code ? I have heard something about JNI, but I don't really know what that is.

    The comparison would be unfair (by your definition of unfair) in Java, too, since the JVMs for both platforms are different.
    If you are dealing with time, though, 500 milliseconds is 500 milliseconds, no matter what language you write it on or what platform you run it on. If you use VC++ for the Windows stuff, make sure you disable Microsoft extensions so you have some ANSI standard code that will compile with gcc.
    Since you are trying to compare operating systems, make sure both machines are using the same processors (and motherboards with the same PCI bus architecture), too. And have the same amount of memory, which is the same speed and architecture on both. Their hard drives should be roughly the same speed, too. The PCI bus usage could vary with network cards, so having the same network cards will be a plus. What it seems to come down to is that you are going to end up measuring the performance of the socket library implementations on both machines.
    As far as JNI goes, all it is is a way to write native code and use it in your Java application. I don't know much about it, search around for some examples. There's a tutorial, somewhere, too. Some dude on here, tpritchet, seems to know a lot about it.
    Jason

Maybe you are looking for

  • Why inspect element is not working in firebug after updating firefox to 14 version?

    firefox upgraded to 14.0.1. After this, I am not able to see element html code in firebug. i.e inspect element is not working as expected.

  • Org.xml.sax.SAXException: oracle.AWXML.Index

    i got the following error when i try to create an analytic workspace from a template file, in Analytic workspace manager 10g. Unable to create Analytic Workspace From file c:\...\global.xml org.xml.sax.SAXException: oracle.AWXML.Index at oracle.AWXML

  • Mac Mini only boots to wallpaper

    I have a 1.66 older mac mini that I am trying to set up but whenever it boots it only goes to a picture of the desktop, No log in screen and it only finishes about half of the loading mac osx progress bar. i ran the permissions and disk check and it

  • Tolerances not copied ECC PO

    Dear Experts, We have noticed a problem with tolerances not being replicated to ECC.  Upon creation of a PO(with reference to a SHC with a contract) in SRM, the over and under delivery tolerances set in the contract are copied in the SRM PO.  Once th

  • Reading and Splitting

    I have 5 classes: Fruit Apple, Melon and gooseberry extends Fruit and has few additional attributes of their own FruitExpert is the main class I have to read from a file which is record based according to the first line. For Eg: APPLE CRISPIN YELLOWI