For (int i = listeners.length-2; i =0; i-=2) {

Hi,
protected void fireFooXXX() {
     // Guaranteed to return a non-null array
     Object[] listeners = listenerList.getListenerList();
     // Process the listeners last to first, notifying
     // those that are interested in this event
     for (int i = listeners.length-2; i>=0; i-=2) {
         if (listeners==FooListener.class) {
// Lazily create the event:
if (fooEvent == null)
fooEvent = new FooEvent(this);
((FooListener)listeners[i+1]).fooXXX(fooEvent);
Why is the listeners list traversed by 2?
Devyn

^^, nm, I see now.
Devyn

Similar Messages

  • How to implement this C code line: for ( int i = 0; i G_ReadLen; i = i + 2 )

    I want to implement the following C++ code in labview but i cannot make or loop to increase by two
    int j = 0; for ( int i = 0; i < G_ReadLen; i = i + 2 ) {
    BYTE AD_H = ByteArray.GetAt(i);
    BYTE AD_L = ByteArray.GetAt(i + 1);
    ValueArray[j] = AD_H << 8;
    ValueArray[j] = ValueArray[j] + AD_L;unsigned long Temp = ValueArray[j] >> 12; Volts[j] = ((float)ValueArray[j]) * 0.0048875;Message.Format("%X , %X - %X, -- %d, +%.3f Volts", AD_H, AD_L, ValueArray[j], ValueArray[j], Volts[j]); m_output_ep1i.InsertString(0,Message);
    j = j + 1;
    Thanks
    Solved!
    Go to Solution.

    Your code will not work.
    You are replacing elements of an empty array. A no-op in LabVIEW.
    Besides there is a lot easier way to do this:
    I just hope this is not a homework assignment.
    And for completeness sake here is Mikes solution (seen below):
    Ton
    Message Edited by TonP on 11-14-2008 12:55 PM
    Message Edited by TonP on 11-14-2008 01:03 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Read as U16.png ‏2 KB

  • Monitoring template for hosts and listeners

    I've created a monitoring template through "setup -> monitoring template -> create". Under the "policies" tab I am unable to locate some policies for hosts and listeners such as "Listener.ora Permission" and "Open Ports". However, I can see (under policy rules library) that those policies are applied to all targets by default. How do I add those policies into my monitor template?
    I am using 10.2.0.4 OEM grid control repository and agents on Sun Solaris 10.
    Thx.

    Hi,
    The Hyper-V guest can be specific the Memory weight and total number of CPU, please first confirm you have set the proper value for the vm workload.
    You can refer the following step by step Hyper-V performance troubleshooting steps set the performance monitor:
    Performance Management: Monitoring CPU Resources….
    http://blogs.technet.com/b/chrisavis/archive/2013/03/25/performance-management-monitoring-cpu-resources.aspx
    Monitoring Hyper-V Performance
    http://blogs.msdn.com/b/tvoellm/archive/2009/04/23/monitoring-hyper-v-performance.aspx
    Measuring Performance on Hyper-V
    http://msdn.microsoft.com/en-us/library/cc768535(v=bts.10).aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Blah.equals() for ints?

    I know for strings and such you sometimes have to use .equals() since they may not point to the same object but the values may be the same.
    What is the equivalent expression for ints?
    == isn't working, and if I use equals it gives the error:
    "int cannot be dereferenced"
    Edit:
    Wait a minute... if I have two int variables with the same value, I SHOULD be able to use ==, shouldn't I?????????
    Edit 2:
    Nevermind.

    String and int are completely different data types. String is an object and extends the java.lang.Object class in Java. The Object class defines the method equals() which compares references between two Objects and returns true if the references are equal. The String class overrides this method to return true if the content of the Strings being compared is the same.
    To compare int, you can very easily use '=='. Of course it works!

  • ArrayList for ints?

    I want to have an expandible and contractible int array. I was thinking of modifying the source code of ArrayList so that rather than being exclusively for objects, it was just for int arrays. Or is there already a Class out there that handles this. I apologize in advance if the answer is very obvious.

    Supp4sk1llz wrote:
    If you didn't know its:
    ArrayList<Integer> intArrayList = //....
    That would be an example of Generics. While autoboxing maybe involved your code does not show it. A better example is:
    Integer num = 5;
    int x = num;
    // instead of
    Integer num = new Integer(5);
    int x = num.intValue();

  • Send request for INT has no recipients(Alerts)

    Hey
    guys i m trying to configure alerts for my scenario and following Michals blog,alert waz triggered once but after that i m getting the following error "Send request for INT has no recipients".in SU01 i have given e-mail address and have admin permission,alerts are not triggered in SLG1 at all and in table SALRTTROLE,i dont see any values.
    any idea where should i start lookin?
    i have followed the troubleshootin blog too but couldn't solve
    thanx
    ahmad

    thanx Satish
    but i have gone through that thread,actually whats happening is that once i create a alert and trigger it by sending wrong data,i can see it in my alert inbox in RWB,but after that if i resend wrong data again,i dont see it,i have unchecked the "Supress multiple alerts " in Alert configuration too.
    i m getting the following warning
    Address of recipient AHMAD (INT) could not be read
    Message no. SALERT033
    Diagnosis
    The communication data for communication method INT could not be determined for recipient AHMAD.
    and after this warning in next line i get the following error
    Send request for INT has no recipients
    thanx
    ahmad
    Message was edited by:
            Ahmad

  • Parameters for Ingesting wide fixed-length files?

    I created an SSIS process to ingest fixed-length text files into this table.
    CREATE TABLE [dbo].[Temp_Source_Fixed](
     [Column 0] [text] NULL,
     [ID] [int] IDENTITY(1,1) NOT NULL,
     CONSTRAINT [Temp_Source_Fixed_ID] PRIMARY KEY CLUSTERED
     [ID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    It works fine with most of the files, but one file has almost 26000 characters per row and the process halts with a truncation error.
    I suspect that if I change a parameter on the connection manager it will work, since I can manually use
    the SSMS wizard to import manually if I specify Text Stream (DT_Text) for the data type of Column 0 versus String (DT_STR).
    For the connection manager I have
        In the connection string I have Provider=SQLNCLI10.1 and Auto Translate=False.
        In Misc parameters, DelayValidation=False.
    For the Data Flow Task I have
     DefaultBufferSize is 10485760
    Any ideas on what I need to change?
    Thanks,
    Jnana
    Jnana Sivananda

    You need the column in question defined in SSIS as DT_Text.
    You need to either drop the flat file connector and re-do it with this datatype, or access the Advanced Editor input and output column and alter its datatype there
    Arthur
    MyBlog
    Twitter

  • Open jpg image for readin error -- bandOffsets.length is wrong

    I have the following code to open and image for reading:
              BufferedImage image = javax.imageio.ImageIO.read(new File(url));
    very easy.
    But, I get an error with some images, the error is:
    Exception in thread "main" java.lang.IllegalArgumentException: bandOffsets.length is wrong!
         at javax.imageio.ImageTypeSpecifier$Interleaved.<init>(Unknown Source)
         at javax.imageio.ImageTypeSpecifier.createInterleaved(Unknown Source)
         at com.sun.imageio.plugins.jpeg.JPEGImageReader.getImageTypes(Unknown Source)
         at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source)
         at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
         at javax.imageio.ImageIO.read(Unknown Source)
         at javax.imageio.ImageIO.read(Unknown Source)
         at notDefaultPackage.TestOpenImage.main(TestOpenImage.java:16)
    Any idea about what cause the error or how to solve it.
    Thanks for any idea or comment.
    Albert

    The relevant code in the java classes is this:
            public Interleaved(ColorSpace colorSpace,
                               int[] bandOffsets,
                               int dataType,
                               boolean hasAlpha,
                               boolean isAlphaPremultiplied) {
                if (colorSpace == null) {
                    throw new IllegalArgumentException("colorSpace == null!");
                if (bandOffsets == null) {
                    throw new IllegalArgumentException("bandOffsets == null!");
                int numBands = colorSpace.getNumComponents() +
                    (hasAlpha ? 1 : 0);
                if (bandOffsets.length != numBands) {
                    throw new IllegalArgumentException
                        ("bandOffsets.length is wrong!");
                }Did you maybe save an image as jpeg that contained transparency? When I do that with GIMP a warning pops up telling me that jpeg does not support transparency and if I would like to ignore or export. Here you should choose export.
    If that is not the problem I suggest you put some breakpoints and start debugging.

  • How Can I Search for Media files by Length?

    I want know how can I search for media files (mov, mp4, flv and movie files in general) by their length?
    If this search function is confirmed as definitely not possible on the OS, I would appreciate someone recommending app that might be able to perform such a search?
    Many thanks

    No possible way. Because the files may be enoded with differing codecs, compression, etc., you can only sort by file size, not the 'length' of the movie files.
    Clinton

  • Dynamic Variable name (for int/long) from a String variable

    Hi,
    I want to give a int/long variable name from a String.
    for ex.
    String str = lookup + "Id";
    lookup is a String variable coming from XML. Now, for instance lookup="name". So str = "nameId".
    Now I want to create a int/long variable by nameId.
    Could anybody tell me the way how to do. Please don't tell to use MAP.
    Edited by: Shah on Dec 5, 2007 3:26 PM

    Well you can't. Use a Map.
    The compiler translates variable names into slot numbers, either within an object or withing the local "stack frame" and these slot numbers are assigned names at compile time. No new slots can be created at run time. Java is not Basic.
    Reflection allows you to find existing field names and methods (not local variables), so it's possible to map, for example, XML attribute names to field names or setters in an object but the names have to be known at compile time.

  • FILE model support for CSV and fixed-length format!!

    Hi all,
    As I'm working on a data conversation project, we are in the middel to design whether the extraction for the data source should be in CSV or fixed-length. Here is the pros and cons:
    CSV:
    1. There are a lot of remarks field in the data which are all free text. It's really hard to define the record delimiter.
    2. Extracted file size for CSV is relatively small compare with fixed-length.
    fixed-length:
    Even for fixed length, we can either
    1. Extract the file without an separator/delimiter (1 row) with fixed column length
    2. Extract the file with fixed column length per record and define the record delimiter to separarter the record.
    I'd try all the above formats and it seems ODI is more prefer on CSV or combined mode (fixed column length) as:
    1. The LKM (file to external table) need to be customzised to handle the file format which without any separator/delimiter
    2. It is very hard to reverse the column definition for fixed-length (no delimiter)
    Any suggestion?
    Tao

    You can transform your files to an xml format using respective tags:
    eg:
    <?xml version="1.0" encoding="UTF-8"?>
    <MONEY>
    <MoneyID>MoneyID0</MoneyID>
    <ContractID>ContractID0</ContractID>
    <EffectiveDate>2006-05-04T18:13:51.0Z</EffectiveDate>
    <MessageDate>2006-05-04T18:13:51.0Z</MessageDate>
    <ReversalIndicator>false</ReversalIndicator>
    <PriorMoneyID>PriorMoney, something "ID0" for life;</PriorMoneyID>
    <Amount>0</Amount>
    <MoneyType>0</MoneyType>
    <ExchangeDetails>
    <CostBasis>0</CostBasis>
    <ExchangeType>0</ExchangeType>
    <MEC>false</MEC>
    <LoanAmount>0</LoanAmount>
    </ExchangeDetails>
    </MONEY>
    So, as you see, you can embed any symbol in a tag.
    After creating this xml file, you can use XML technology in Topology Manager to map to this file and then create a data store based on this technology.
    And you will be able to retrieve the data in this file under respective column headers without worrying about delimiters existing in the actual data.

  • A & b works also for int primitives ?

    Hello
    During my lessons java SCJP 5.0 I saw that the & expression also excepts integers as oprands.
    But how can i predict the outcome of such an expression.
    For example
    int a=1,b =1;
    a++;
    System.out.println(a & b); // Prints 0
    a++;
    b++;
    System.out.println(a & b); // Prints 2
    I don't understand how Java calculates these outcomes
    How does the & work with int operands?
    thanks in advance, Auke Quist

    The error code is in the html code for the Web page and not an error you can fix.

  • Planned cost for int labour and non stockable material not visible

    Hey gurus,
    While creating an order with a material, ext service, non stock material, I am able to see the planned cost for materials in stock and ext services procured. But i'm not able to see the planned cost for non stock material and int labour. However i'm able to see the actual cost for all the items. I think I have missed some config. Please help.
    Regards,
    Abhishek

    Hi,
    As said by Pithan there is a problem in costing variant for planned cost which you have assigned to prder type at plant level.
    Problem underlies within valuation variant assigned to costing variant.PM01 is your costing variant here.Check diiferent heads within valuation variant for this costing variant.There under activities tab what is calculation parameter you have selected.If it is blank you will not get any internal activity cost.You need to select at least one from dropdown like cost from previous period or avaerage cost etc.Then you will get planned cost for internal activities.SAmething applies to non stock material.
    Check in OKP6 for all these and make sure that you have selected at least one cost calculation schema there for activities and material and external.
    Regds,
    atul

  • Documentation for custom event listeners

    Hi,
    I am searching in portal 8.1 documents for using custom events, coding and registering event listeners, and using them in jsp pages. So far my search has been unsuccessful.
    Can some one let me know where i find this info?
    -thanks

    Hi J, 
    Thanks for your reply.
    I didn’t find the custom work item Web Access control Official documents, but you can refer to the information in these articles(it’s same in TFS 2013):
    http://blogs.msdn.com/b/serkani/archive/2012/06/22/work-item-custom-control-development-in-tf-web-access-2012-development.aspx
    http://blogs.msdn.com/b/serkani/archive/2012/06/22/work-item-custom-control-development-in-tf-web-access-2012-deployment.aspx
    For how to debug TFS Web Access Extensions, please refer to:
    http://www.alexandervanwynsberghe.be/debugging-tfs-web-access-customizations/.
    For the custom work item Web Access control Official documents, you can
    submit it to User Voice site at: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them seriously.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Ironport C160-Best practice config for my 2 listeners?

    I am trialling an Ironport C160.
    I want it to scan inbound and outbound mail. I have configured a public inbound listener for mail from the internet. It is configured to accept all my domains, and forward them to my exchange server. It does LDAP lookups for recpients to ensure they are valid. It uses the Data1 interface on the ip address of the Ironport and also has the hostname ironport.mydomain.com.
    What is the recommended way to configure the private outbound listener? I just want it to do simple av scanning, then pass it on to my ASA.
    Should I configure a new interface o Data2, and use port 25? If so, what would the hostname be?
    Or use the same interface and use port 24 instead?
    What are the pros and cons of each setup?

    Please note that you can add your Exchange server IP address into RELAYLIST or any sender group with RELAYED mail flow policy or mail flow policy with 'Relay' connection behavior. Add IronPort listener iP as smart host on Exchange server. All emails from Exchange server will then be treated as outgoing emails and envelope recipient address will not be checked against LDAP.
    Most of my customers simply use one listener for both incoming and outgoing emails. You can choose to have multiple listeners for incoming (e.g. Different domains want to have their own MX IP addresses, sender groups for whitelist, greylist, blacklist domain/IP ranges) and outgoing emails (e.g. Not adding 'Received' header for outgoing listener for security reason).
    Please note that there is a restriction that you cannot configure IP addresses on same network range on different physical interfaces on IronPort.
    You can also configure multiple IP interfaces or interface groups on IronPort such that you can deliver emails for different domains, normal or urgent, management or marketing or other emails by different IP addresses or IP range.

Maybe you are looking for