Want to achieve Iteration

Hi,
I am tying to achieve a balance in Assets and Liabilities plus equity by placing a balancing figure through a rule that calculates difference and places it in either Assets or Liabilities depending on which side is lower.
The problem arises when i have to calculate interest on that balancing figure which in turn increases equity(if it is interest income) or reduces(if it is interest expense).
The formula recalculates the new balancing figure and replaces the original one.
The new figure calculated is lower than the first one and balance is not achieved .
In excel we can achieve this process by using Iteration. i wan to to achieve the same in Hyperion through a BR. Is there any function available for that??
Thanks in advance
Edited by: ar_aff on Sep 29, 2011 12:22 AM

Hi,
Thanks for the solution, I have knowledge of it and it does not solve the issue . numerically speaking i am saying the following:
Nature of balancing asset is of Investment which gives interest.
Asset=80
New Asset (Balancing figure calculated by Liabilities+Equity-Asset)=30
Liability=80
Equity=30
Interest on the Balancing Asset =5 (assumed)- This is the figure that is making the equation imbalance. Rule places this figure in the New Asset cell
Now new values become
New Asset=80
*Asset (New figure replaces old one)(Balancing calculated by Liabilities+Equity-Asset)=5
Liability=80
Equity=35
* New Asset figure calculated from loop is 5, it balances the entire but the problem appears when the new figure is replaced on the previous figure cell and the balance goes out. Old figure was 30. New figure should have been 35 but it becomes 5*. No matter how many loops we have with any condition it does not balance.

Similar Messages

  • I want to achieve this effect

    I am an inexperienced Motion user just beginning to explore its possibilities (I'm using Motion 4).  I'm trying to create some title effects that closely match the trailer to the movie "Enchanted".  See link here:  http://www.youtube.com/watch?v=uW6dNiOIOhA.   At about 9 seconds and 14 seconds into the trailer, you see a flash effect and some wording.  I'd like to know how you can (or if you can) achieve that same flash effect in Motion.  Also, I would like to create lettering that is just as polished as what's in this trailer.   Again, I'm just getting started, but was wondering if someone could point me in the right direction.  thanks.

    Pointing you in the "right" direction is about as good as you can get. This is not a beginner's project, and if you can work through it, you will not be a beginner anymore! (Because you've got to "peel through" a "bunch of stuff" to get this done.) (Also, this is not even an exact duplicate of the effect, only an approximation. To get the exact effect will take a lot more work... and ingenuity.)
    For the underline:
    Draw a line shape — about the width of the canvas (you'll need the "overhang")
    The Brush Type must be Airbrush [Brush Color: white]. [You'll want to adjust the spacing downwards to around 15% or so.]
    The taper of the line is determined by "Width Over Stroke" (in the Stroke pane of the shape's inspector -- you can add points to the line by double clicking on the line [turn down the disclosure triangle] and you can adjust it's position settings with the parameter controls underneath the graph [the "Width Over Stroke" and "Stroke Length" parameters].)
    For the example below, I have the stroke width set at 3 (from the Style > Outline pane) and the 50% (Stroke Length) location of the Width Over Stroke set for 600% -- and either end set for 0% (that's why you'll need the "overhang"). I have the Brush Opacity set for 7.2% and I used a Circle shape (scaled and stretched to fit within the line below it to create a "bright spot" — however, there is also an Opacity over Stroke parameter you could manipulate instead [not as easy to pull off; but probably better end result when you figure it all out].) In the Properties for the Circle overlay, set the Blend Mode to Add; and add Shape>Style>Fill>Feather of about 50.
    [There's an easy onscreen way to manipulate the Width Over Stroke of a line... a little beyond the scope of this topic though... check the manual.]
    The Line and the Circle should be in the same Group. To the Line, add an Outer Glow and Aura (Glow filters group.) You can use the Outer Glow colors to manipulate the glow effect coloration (it's a little too blue in the snapshot above). To the Group, add a Dazzle filter (also a "glow" filter). You're going to have to try to adjust these yourself as the settings will depend *greatly* on the "physical" properties of the line you have created.
    For the text "brushed metal" effect: this is just a matter of creating a Gradient Fill:
    You can position and add color "patches" by clicking on the color line portion of the gradient control (the top line is the Opacity, the middle section/line is the gradient's appearance, and the bottom section are the color "stops" that you create and position to control the gradient design.) You can set the color for the stop by right-clicking on the patch and selecting from the popup picker. Adjust the color stops (horizontal position) to line up the effect you want on the text (it updates in real time so you can watch it right on the text).
    The Text font is Goudy Old Style (it's available in Motion 5 as part of the FCPX collection) with All Caps turned on (cap size: 80%).
    For a little extra "punch" on the text, add a Dazzle filter and set the brightness to about 51% and adjust the other parameters to taste.
    If you had Motion 5.0.5 or later, you could download this demo project to look at the parameter settings I used: http://sight-creations.com/fxexchange/enchanted_underline_demo.zip .  This will NOT open in Motion 4 or earlier versions of Motion 5.  (I have an extra Dazzle filter on the Line which can be turned on or off depending on if it would be "useful" or not, for those who do download it.)
    PS: Once you have created the Line effect you like, Clone it and use clones for resizing (scaling) and reusing for an animated title. [To create a clone: select the entire group the line effect is created within and type the K key. Any changes you make to the original artwork will be reflected in all the clones you create, but the individual clones can be transformed by position, scaling and rotation without affecting any of the other "copies"/clones. ]
    Hope that gives you enough info to get started on it. Hope I *covered* everything!
    Good Luck!  (Get Motion 5 -- it's worth it. But keep Motion 4... just b'cause... )

  • Want to remove iteration in this query

    below mention query is showing results ok but problem is i have used iteration due to this it will slow down many many times if no. of transactions increases
    can i use this query without iteration please help me out?
    select
    SNO,NDATE,SERIALNO,LOCATIONCODE,IORTYPE,TRNTYPE,CAPITALIZE,QTYRATE,ACCESSORYCODE,QTY,RATE,AMOUNT "AMT",C_QTY "RUNQTY",AVG_RATE "RUNRATE",C_AMOUNT "RUNAMT"
    from ( select * from ( select t.*, max(dim) over () number_of_iterations,
    max(dim) over (partition by accessorycode) number_of_item_codes
    from ( select t.*, row_number() over (partition by ACCESSORYCODE order by SNO) - 1 dim
    from DENIM.V_RUNAVG1 t) t)
    model partition by (accessorycode)
    dimension by (dim)
    measures (SNO,NDATE,SERIALNO,LOCATIONCODE,IORTYPE,TRNTYPE,CAPITALIZE,QTYRATE,QTY,RATE,AMOUNT,0 as C_QTY,0 as AVG_RATE,0 as C_AMOUNT, number_of_iterations,number_of_item_codes) rules iterate (10) until iteration_number >= number_of_iterations[1] ( rate[iteration_number] = case when iteration_number > 0 and qtyrate[iteration_number] < 0 then avg_rate[iteration_number - 1] else rate[iteration_number] end, amount[iteration_number] = qty[iteration_number] * rate[iteration_number], c_amount[iteration_number] = case when iteration_number > 0 then c_amount[iteration_number - 1] + amount[iteration_number] else amount[iteration_number] end, c_qty[iteration_number] = qty[iteration_number] + case when iteration_number > 0 then c_qty[iteration_number - 1] else 0.0000000001 end, avg_rate[iteration_number] = c_amount[iteration_number] / c_qty[iteration_number] )) where dim <= number_of_item_codes order by accessorycode, dim

    TKPROF: Release 10.1.0.2.0 - Production on Thu Jun 5 03:35:34 2008
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    Trace file: d:\oracle\product\10.1.0\admin\sd\udump\sd_ora_2420.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    alter session set sql_trace true
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.04          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.00       0.04          0          0          0           0
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 91 
    select
    SNO,NDATE,SERIALNO,LOCATIONCODE,IORTYPE,TRNTYPE,QTYRATE,ACCESSORYCODE,INVTYPE,
    QTY,RATE,AMOUNT
    "AMT",C_QTY "RUNQTY",AVG_RATE "RUNRATE",C_AMOUNT "RUNAMT"
    from ( select * from ( select t.*, max(dim) over () number_of_iterations,
    max(dim) over (partition by accessorycode) number_of_item_codes
    from ( select t.*, row_number() over (partition by ACCESSORYCODE order by
    SNO) - 1 dim
    from DENIM.WGTAVGRATE1 t) t)
    model partition by (accessorycode)
    dimension by (dim)
    measures
    (SNO,NDATE,SERIALNO,LOCATIONCODE,IORTYPE,TRNTYPE,INVTYPE,QTYRATE,QTY,RATE,AMOUNT,0
    as C_QTY,0 as AVG_RATE,0 as C_AMOUNT,
    number_of_iterations,number_of_item_codes) rules iterate (700) until
    iteration_number >= number_of_iterations[1] ( rate[iteration_number] = case
    when iteration_number > 0 and qtyrate[iteration_number] < 0 then
    avg_rate[iteration_number - 1] else rate[iteration_number]      end,
    amount[iteration_number]   = qty[iteration_number] * rate[iteration_number],
    c_amount[iteration_number] = case when iteration_number > 0 then
    c_amount[iteration_number - 1] + amount[iteration_number] else
    amount[iteration_number] end, c_qty[iteration_number] =
    qty[iteration_number] + case when iteration_number > 0 then
    c_qty[iteration_number - 1] else 0.0000000001   end,
    avg_rate[iteration_number] = c_amount[iteration_number] /
    c_qty[iteration_number]   )) where dim <= number_of_item_codes order by
    accessorycode, dim
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.02          0          0          0           0
    Execute      1      0.00       0.01          0          0          0           0
    Fetch     2169    127.60     166.60       1244        382          0       32516
    total     2171    127.60     166.65       1244        382          0       32516
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 91 
    Rows     Row Source Operation
      32516  SORT ORDER BY (cr=382 pr=1244 pw=868 time=166423096 us)
      32516   VIEW  (cr=382 pr=1244 pw=868 time=23883740 us)
    2516500    SQL MODEL ORDERED FAST (cr=382 pr=1244 pw=868 time=36303648 us)
      32516     VIEW  (cr=382 pr=376 pw=0 time=3313485 us)
      32516      WINDOW BUFFER (cr=382 pr=376 pw=0 time=3183412 us)
      32516       VIEW  (cr=382 pr=376 pw=0 time=3096441 us)
      32516        WINDOW SORT (cr=382 pr=376 pw=0 time=2933851 us)
      32516         VIEW  (cr=382 pr=376 pw=0 time=2877298 us)
      32516          SORT ORDER BY (cr=382 pr=376 pw=0 time=2747228 us)
      32516           HASH JOIN  (cr=382 pr=376 pw=0 time=1891717 us)
      14134            TABLE ACCESS FULL OBJ#(57651) (cr=206 pr=203 pw=0 time=111724 us)
      32516            TABLE ACCESS FULL OBJ#(57650) (cr=176 pr=173 pw=0 time=195574 us)
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.02          0          0          0           0
    Execute      2      0.00       0.05          0          0          0           0
    Fetch     2169    127.60     166.60       1244        382          0       32516
    total     2172    127.60     166.69       1244        382          0       32516
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        2      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.01          0          0          0           0
    Fetch        2      0.00       0.00          0          4          0           1
    total        6      0.00       0.01          0          4          0           1
    Misses in library cache during parse: 2
    Misses in library cache during execute: 2
        2  user  SQL statements in session.
        2  internal SQL statements in session.
        4  SQL statements in session.
    Trace file: d:\oracle\product\10.1.0\admin\sd\udump\sd_ora_2420.trc
    Trace file compatibility: 10.01.00
    Sort options: default
           2  sessions in tracefile.
           2  user  SQL statements in trace file.
           2  internal SQL statements in trace file.
           4  SQL statements in trace file.
           4  unique SQL statements in trace file.
        4740  lines in trace file.
         298  elapsed seconds in trace file.

  • Want to achieve FCCat receiver side while field sepreted by'nl'&fixedlength

    Hi all
             I am trying an idoc to file scenario in which my output file is a flat file
    structure having Recordset structures Header, Data Item &Footer .In item the field
    are in fixed length as well as in new line also.I am bit confused how to achieve this
    I have also gone through help doc but not getting proper idea. for detail understanding i am giving the struct of my o/p flat file......................
    PM157610100000305000126 (header)
    2803010138951000127290100000005USC  2007062720070627SSDASDSA       
    000000000789EUR               (tow row of item fields)
    PM15000001  (footer)
                                          Plz do the needful help by sharing your views on this issue
    Regards
    Neha

    Roy,
    In your file receiver communication channel select the option content Conversion. In recordset structure you give Header, DataItem, Footer and give this parameters:
    Header.fieldFixedLengths
    Header.endSeparator
    Header.addHeaderLine :   0
    DataItem.fieldFixedLengths
    DataItem.endSeparator
    DataItem.addHeaderLine :   0
    Footer.fieldFixedLengths
    Footer.endSeparator
    Footer.addHeaderLine :   0
    Also check this help for reference:
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    Regards,
    ---Satish

  • Suspend 20 Iterations Error in Soap Assess Response (ODS)

    OPA Experts,
    I'm trying to replace the default error message you receive when the inferencing cycle has errored-out after 20 iterations. I'm restricted to using ODS and none of the features of OWD. Using Java framework.
    I've encountered this several times before and was able to stop via error() in the rules, but for this particular instance (see below), I can throw the error and view both this and the 20 iterations message in OPM (20 iterations in red box at top of OPM interface and custom error message in output window), but the soap assess response presents the 20 iterations (ThinkException) message and nothing else.
    "This particular instance" means an illegal attribute value and relationship population in the same entity. E.g. TaxReturn entity --> <attribute>tax_filing_status = "Single" and <relationship>tax_filing_spouse populated. A person filing a tax return can only have a tax_filing_spouse populated when they have a tax_filing_status of "Married Filing Jointly".
    What I've tried so far:
    Catching and throwing the error via rules
    OnReturnResultEvent
    InferencingListener
    SoapServerException
    ThinkException override (which isn't really possible but I thought I'd try anyway )
    OnBeforeThinkEvent
    The request, in all of the above cases, only touches my empty constructors and none of my methods.
    Here's one example (among many) of my log4j log (edited for space and readability purposes):
    ========================================================================================
    388 [http-127.0.0.1-9000-Processor4] INFO  com.oracle.util.plugins.PluginRegistry  - Successfully created plugin factory: handleIllegalTaxRequest.HandleIllegalTaxRequest
    8509 [http-127.0.0.1-9000-Processor2] INFO  com.oracle.determinations.engine.Session  - User setting attribute i_return_filing-status, entity taxreturn, instance name 54f63ed31435527aebb709fac1417c00, session 1 to value 1
    21080 [http-127.0.0.1-9000-Processor2] INFO  com.oracle.determinations.engine.Session  - Engine inferring attribute o_per_pend-person, entity person, instance name SELF1120128911, session 1 to value true
    21080 [http-127.0.0.1-9000-Processor2] INFO  com.oracle.determinations.engine.Session  - Finishing inferencing on session 1
    21081 [http-127.0.0.1-9000-Processor2] TRACE com.oracle.determinations.ocs.UnknownMemberListener  - In UnknownMemberListener
    21083 [http-127.0.0.1-9000-Processor2] ERROR com.oracle.determinations.server.services.AbstractNativeService  - Could not reach a determination for rulebase 'FakeNameOfRulebase'. Reason: Think cycle has not stabilised after 20 iterations.  This is probably due to a fault in the inferencing listener.
    com.oracle.determinations.server.exceptions.ThinkException: Could not reach a determination for rulebase 'FakeNameOfRulebase'. Reason: Think cycle has not stabilised after 20 iterations.  This is probably due to a fault in the inferencing listener.
      at com.oracle.determinations.server.assess.AssessEngine.assess(AssessEngine.java:147)
      at com.oracle.determinations.server.services.assess.AssessAction.process(AssessAction.java:67)
      at com.oracle.determinations.server.services.AbstractNativeService.processRequest(AbstractNativeService.java:119)
      at com.oracle.determinations.server.DSServlet.doPost(DSServlet.java:103)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      at java.lang.Thread.run(Thread.java:722)
    ========================================================================================
    None of the inferencing responses in any of my logs present "tax_filing_spouse" relationship...so I must assume it's getting hung up on this. If I change the tax filing status in the request, I get the correct assess response with 0 errors. I tried getDecisionReport() of InferencingEvent to verify, but as mentioned above, only my constructors are being touched and none of my methods.
    Now, I could be approaching this incorrectly in my Java code, or there could be a way to catch and suspend this in the rules, but I've extended the capacity of my efforts and am about ready to throw my laptop out of the window. Any help would be greatly appreciated. I really need it!!!!
    v/r
    Mike

    Hi Mike,
    I'm not really sure what you want to achieve, this error message means that your assessment results are invalid and none of the conclusions can be relied upon so you really need to fix the rules themselves. This error can be caused by a loop in the rule logic as well as a a problem with an inferrencing listener (as suggested in the error message). You can check for rule loops in OPM and / or use visual inspection as you know which attribute / value triggers the problem.
    If you could share your rulebase and the source code for your UnknownMemberListener that may shed some light on the issue.
    If you really need to change the error message to you SOAP clients you may need to implement a custom service but this is unlikely to be trivial.

  • Using RegEx to achieve the following

    Here is what I want to achieve:
    INPUT:
    access-list 99 permit 172.0.0.0 0.255.255.255
    access-list 99 permit 192.168.0.0 0.0.255.255
    access-list 99 deny any
    snmp-server community Cust1 RO 99
    snmp-server community Cust1-RW RW 99
    snmp-server community Cust1-RW RW 100
    The intent is to find the any snmp-server line that has a number at the end which is not defined in the above set of lines. In the above example we should be able to find the last line.
    How can we do this in pure java regex.
    I highly appreciate any response on this.
    Thanks
    Sanjeev

    Hi,
    I don't know what you mean by "pure java regex". But you could try it with something like this:
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.regex.Pattern;
    import java.util.regex.Matcher;
    class RegEx {
        public static void main(String[] args) throws Exception {
            BufferedReader br = new BufferedReader(new FileReader("file.txt"));
            String line;
            HashSet set = new HashSet();
            Pattern p1 = Pattern.compile("access-list (\\d*) .*");
            while ((line=br.readLine()) != null) {
                Matcher m = p1.matcher(line);
                if (m.find()) {
                    String number = m.group(1);
                    if (!set.contains(number)) {
                        set.add(number);
            br.close();
            br = new BufferedReader(new FileReader("file.txt"));
            StringBuffer sb = new StringBuffer();
            Iterator iter = set.iterator();
            if (iter.hasNext()) {
                sb.append(iter.next().toString());
            for ( ; iter.hasNext(); ) {
                sb.append("|");
                sb.append(iter.next().toString());
            String regex = "snmp-server.* " + sb.toString() + "$";
            Pattern p = Pattern.compile(regex);
            while ((line=br.readLine()) != null) {
                if (line.startsWith("snmp-server")) {
                    Matcher m = p.matcher(line);
                    if (!m.find()) {
                        System.out.println(line);
    }Stefan

  • How to keep track of an iterator?

    Hi everyone.
    I'm having an issue trying to keep track of an interator in a tree map.
    Basically my application is an address book, and it has the following button:
    First Prev Next Last
    So if they press the first button it will run the following code:
      Collection c = treeMap.values();
            //obtain iterator for tree map
            Iterator iter = c.iterator();
            //get first item in the list
            Contact temp = (Contact)iter.next();This works fine.
    But now I'm trying to get the Last element in the tree and then assign a "global" iterator to it, infact all the buttons should have an iterator that will keep track of where the current element is...and thats where I'm having problems with.
    So if I get the first element when someone presses the first button, I would like to now assign an iterator to that position, so if someone presses the Next button, I would just do iter.next(); and then display the information .
    The problem is though, I also need to go back 1 element if the user presses the Previous button...is there a way to go forward and backward with an iterator?
    I have an internal iterator keeping track of things but I get an error, like for example:
      Collection c = treeMap.values();
             int count = 0;
            //obtain iterator for tree map
            Iterator iter = c.iterator();
            while(iter.hasNext() && count < treeMap.size()-1)
                count++;
                iter.next();
            trackIter = iter.next();trackIter = iter.next();
    I want trackIter to point to whatever iter.next() is pointing at, which in this case, is the last element in the list but I get an error here saying:
    found : java.lang.Object
    required: java.util.Iterator
    trackIter = iter.next();
    Any ideas?
    Thanks

    First of all your bug.
    Iterators return Objects.
    What kind of object it returns depends on what you were shoving into the Map. If you shoved a Dog into the map, then the iterator returns the Dog, but the Iterator and the Collection only knows that it is an Object, not that it is a Dog. Your code that needed to get a Dog back, needs to cast the result returned by the iterator as a Dog
    trackItem = (Dog) iter.next();
    However, before you haul off and fix your code, twould be best to fix your design. Your question, "is there a way to go forward and backward with an iterator?" is a good question. Before I tell you the answer, let me ask you a question? What are you going to do if the answer is "NO - you can't go forward and backward"
    I mean, it's OK to hack and slash around, trying this and that, but generally it would be good to know the answer to that question BEFORE you write a bunch of code involving iterators, because when you find out that you CAN'T go both forward and backwards with an iterator, what are you gonna do. Are you going to leave part of the design working one way, using iterators for going next and then some totally different mechanism to go the other way? Of course you could do that, but that is not really how one arrives at good design, by first hacking out one feature until you can get it working and then turning you attention to the next and hacking out a different bunch of code.
    Observe that Collections can be converted to Arrays and that Arrays have indicies and moving forward and backward in an array is a simple matter of incrementing or decrementing an integer and testing if you fell of the end. Also arrays, having no particular order restrictions can be sorted, or re-ordered any way that you like. How much easier your problem would be if only you had an array instead of a Collection.
    Don't take the criticism of your design the wrong way. I actually like the idea of using something like an iterator for your buttons, but the thing you are using is not really an iterator. As you said it must go both ways. It is really more like a text cursor where you can advance forward and backwards over a list. So build a Cursor class that you can hand an array. Give it routines like, first(), last(), mid(), stepForward(), stepBack(), getCurrent(), getIndex(), setIndex().
    And then you ask yourself, "before I write this code - let me see if someone has already written it." you look up Cursor in the API. Nope, there is a cursor class, but it is for crossHair cursors and the like. Then you ask yourself, "What else could they have called this?" How about ListIterator. Bingo - there you are, an interface class that has hasNext, hasPrevious, ... But it is only an interface. It doesn't do anything. What kind of class would implement this interface? Maybe List, so you look up List. Drat, it is some disgusting awt component. Oh wait, there's another interface, List, and there on the "All known Implementing Classes" you see LinkedList, ArrayList and others.
    Cool. You can reduce a collection to an array, if you could get an array into one of these list types, you could have your interface all built for you and everything, or if it isn't exactly what you want, no big deal, you already know the interface you need, you can just build it, whatever reduces your effort.
    See how it works? And just for the record, I didn't know about ListIterators, when I started typing this. But I know a design principle that helped me find it. I don't grab a component that I know and see if I can make the system work with the thing that I know. Instead I think of what I want it to do, try to design the interface for what I want it to do and then, once I know what I want from a structural standpoint, I start groveling around to see if that thing already exists.
    You were almost there. When you asked if an Iterator goes both forwards and backwards. And the answer is, "No"
    I see that others have posted before I finished writing this tome. Reversing the array and creating an iterator for that list will not get you the behavior that you are in some state, at some place in the list, from which you can go either forward or backwards. It just gets you a way to go backwards through the list.
    On the assumption that you are a student attempting to learn something, I would suggest that you actually do both approaches. Using the ListIterator approach is what you would do in a production environment (I just need this one behavior and it already exists over here) but you will probably learn more if you implement your own cursor class as I described above. The point is that you have a chunk of functionality, knowing where you are in a list and being able to step either forward or backward, that you want to achieve. The way that you get some chunk of functionality is that you design and build a class that lets you get that functionality. Iterator is NOT that class.

  • Find the Duration in Months between the contents in an Iterator

        Iterator<String> termIncomeKeys = termIncome.keySet().iterator();
        while(termIncomeKeys.hasNext()){
            String month = termIncomeKeys.next();
            System.out.println(month);
        } The above code is printing month as
    Jan(2012) - Jan(2012)
    Feb(2012) - Mar(2012)
    Apr(2012) - May(2012)
    Jun(2012) - Jun(2012)
    Jul(2012) - Oct(2012)What I want to achieve is I want to print the duration in terms of months between each of the entries. That is, Duration between first entry is 1 month, duration between second is 2 and so on.

    What you print is a string. You can't do calculations on a string. You have first to disassemble the string into parts and interpret what each part contains. There is nothing out of the box in java to do this. On the other side it's not too difficult to do it yourself.
    Timo

  • Enable Excel Iterative Calculation

    Hello everybody.
    I'm going to try to explain my issue; it could be a little bit long:
    In my Xcelsius Dashborad, the user can make a selection on a List Box component. The value selected is the prompt for a QAAWS that retrieves more detailed data.
    I refresh a graphic based upon one of the columns retrieved. And here comes my trouble: the value could be blank.
    In this case, I want my graphic remains unchanged.
    For doing this, I'm trying to create a formula that copies the value when it changes but left it unchanged (the prior value) when it becomes blank. My first try results in a circular reference
    In B1 cell --> =IF(AND(B1<>A1;A1<>"");A1;B1)
    I've found that there is a way to allow Excel to deal with that. (see this link: http://office.microsoft.com/en-us/excel/HP100662431033.aspx).
    But if I allow circular references in a separete Excel template and then import it into Xcelsius, it seems that goes crazy, and becomes with an unpredictable behavior, and almost always Xcelius brakes after a while.
    So, what I want to achieve is that when a  A cell changes, copy its value to another B cell, and when A becomes blank, do nothing (left the previos value in B).
    I hope I've made understood the problem and anybody can help.
    Thanks in advance.

    Same problem here. After importing an Excel model with iterative calulation enabled Xcelsius notifies of a circular reference. The app does not seem to allow the user to enable this option again (under Excel Options>Formulas>Calculation Options).
    So can Xcelsius handle iterative calulation at this stage?

  • Simple Hashtable problem - Iteration :-)

    I want to achieve the same effect as this code below, but with a hashtable. By that I mean I would like to itterate through a hashtable, but I'm not quite sure how to do it.
    ArrayList rectangles = new ArrayList();
    for (Rectangle rec : rectangles){
    }Thanks,
    Nate

    I read the API which you should too, and i came up with this big bundle of mess, lol enjoy
    private void doSomething(){
      int[] nums = {1, 2, 3};
      Object[] obs = {new Object(), new Object(), new Object()};
      Hashtable data = new Hashtable();
      for(int i=0; i<nums.length; i++){
        data.put(nums, obs[i]);
    Set k = data.keySet();
    Iterator iter = k.iterator();
    while(iter.hasNext()){
    int key = (Integer)iter.next();
    Object o = data.get(key);
    System.out.println(key + " " + o.toString());

  • Using Adobe Photoshop CS2 version 9 and have updated it, but when stacking photos, it comes up with PSD, whereas I want Jpeg, and I change the format to Jpeg and the box then comes up with cannot save as there is a program error. Be very grateful for help

    Using Adobe Photoshop CS2 version 9 and have updated it, but when stacking photos, it comes up with PSD, whereas I want Jpeg, and I change the format to Jpeg and the box then comes up with cannot save as there is a program error. Be very grateful for help with this, please.

    jpg does not support Layers.
    Just to make sure, what exactly do you mean by "stacking photos" and what do you want to achieve thereby?

  • Application Supersedence not working as I want and expect!

    Hello,
    I need help to find out how to properly deploy an upgraded application using the SCCM 2012 Application supersedence.
    What I have
    One application in production with version 1.0. Let us call it APPL-BLUE1.0
    New application of the same product with version 2.0. Let us call it APPL-RED2.0
    What I want to achieve (the goal)
    Users should be notified via the Software Center that a new update is available. The new update should not be installed until the user is ready and manually triggers the installation via the Software Center.
    My configuration settings
    On application APPL-RED2.0 I have gone to Properties -> Supsersedence and added the APPL-BLUE1.0 to the Supsersdence list. Replacement Deployment Type is configured (set to the Deployment type for the APPL-RED2.0) and
    the Uninstall checkbox is checked (to uninstall the APPL-BLUE1.0 deployment type first).
    Install behaviour for APPL-RED2.0 is "Install for system" and "Whether or not a user is logged on" with Normal visibility.
    Then I create the Deployment which I have tried three different ways.
    Action: Install, Purpose: Available, "Automatically upgrade any superseded versions of this application"
    unchecked.
    Action: Install, Purpose: Available, "Automatically upgrade any superseded versions of this application" checked.
    Action: Install, Purpose: Required, "Automatically upgrade any superseded versions of this application" checked (forced, greyed out).
    What happens
    The application is not automatically made available in the users Software Center at all. No notification is presented and the user has to access the installation by looking in the Application Catalogue
    first. Once found in the Application Catalogue the installation runs without problems but this means that the user must somehow know there is a new version available through other means.
    The application is automatically installed (without regard to whether or not the application is in use) on the client and a notification is presented on the users machine (Software Center).
    Exactly the same result as for #2.
    This conflicts with what I want to achieve. I want a notification and that the application is automatically made available for installation in the Software Center but I do not want it to automatically upgrade but rather let the user initiate the installation
    whe he or she is ready (i.e. when the application is not in use).
    Please point me in the right direction in order to accomplish this.
    Thank you.
    Sindre

    Have you tried changing the application deployment evaluation cycle to increase the speed the update is detected?
    also with the notification issue, I have a similar problem and have a script in place. Our business rules are to install the application asap giving the user 6 mins to close it. but this script could easily be changed to allow it to wait non stop.
    Or maybe you could set a requirement for the deployment type, a custom script that checks if the application is running, but I am not sure on what cycle the application will evaluate this. or if it will evaluate it then download the application (leaving
    a window for the application to be run)
    Also in case it is not obvious I have removed functions and keywords. but this should give you an idea of how to achieve your desired results
    'Check if current version
    if CheckMSIVersion("{removed}","removed") = 1 then
    wscript.quit(0)
    end if
    'sets path of script
    strScriptDir = getParentDirectory
    intACProcesses = CountACProcesses
    'Check if running
    if intACProcesses >= 1 then
    'runs warning HTA
    wshShell.Run ("""" & strScriptDir & "\BeforeInstallAlert.hta """),3,False
    'Untill app is closed keep activating alert and checking to see if it is running
    const timeout = 360000
    const timepoll = 15000
    do while intACProcesses >= 1 and i < timeout
    intACProcesses = CountACProcesses
    if intACProcesses >= 1 Then
    wscript.sleep timepoll
    end if
    i=i+timepoll
    wshshell.AppActivate "Appname Upgrade Alert"
    Loop
    end if
    'Kill AC
    killProcesses("appname%")
    'Kill HTA processes
    killProcesses("mshta.exe")
    'Install new and record exit code
    intExitCode = WshShell.Run("msiexec /i """ & strScriptDir & "\removed.msi"" /qn",0, true)
    'if install fails exit with exitcode
    if intExitCode <> 0 then
    wscript.quit(intExitCode)
    end if
    'Run New client
    WshShell.Run("""" & findACProgramDir & "removed.exe"""),1,false
    'Run finished HTA
    wshShell.Run ("""" & strScriptDir & "\AfterInstallAlert.hta"""),3,False
    'Exit with code
    wscript.quit(intExitCode)
    Quote by andhey "hmm ill try it later, i accidentally deleted all my tv shows when trying to delete a word document lmao"

  • I want to be able to view data created with filemaker pro on my muse site

    I have created a muse site and would like to include a page that has five drop down menus on it that pull from a (preferably filemaker pro) database. The idea being, that each dropdown determines where the next set of data is pulled from in the database.
    I have spent some time looking around and seen a lot of information about business catalyst etc but have not seen a clear and definitive answer.
    Can anybody point me in the right direction?
    Many thanks in advance!

    Thank you Anshul, much appreciated. I will look into trying this! Ill get back to you. Thanks for the link too. Ill take the following(see below) from it and try that out too!
    "Late to the party but I've worked with filemaker pro in the past and the BC API extensively.
    Filemaker pro is well filemaker pro, it's meant for little commercial ventures or organizing your CD collections, anything business with over 20,000 records I would use or get something else (like BC). Even MS acesss is better, although harder to use, filemaker is also prone to database corruption so you need to backup.
    For automation, filemaker pro has ODBC connect-ability so you can directly access the data stored within it, piping data in or out or to the BC API if you wanted. Since filemaker pro is a self contained local app (and if I were building something) I would build a little local tool app you could launch and import / export the data for you based on your business rules or what you were trying to automate, this could be automated if you wanted to do something like that.
    If you or anyone is interested, it's relatively straight forward working with ODBC since it's base is SQL to get to the data. Just need the business logic on what you want to achieve."

  • I want to set up 'direct replies to' for all my emails(not just one) to reply to another address in Office Professional Plus 2010

    I went to File,  Info,  Account Settings, Account Settings, E-mail tab lists 'Microsoft Exchange Server', if I click on that and go to Change Folder, I get a pop up message advising me not to select this option, if I carry on I get a pop up to
    set up New E-mail delivery location but I cannot do anything here.
    I have also tried the change option but there are no email options here either.
    It is a company set up, just wondering if it's at all possible to do what I want to achieve under these circumstances, any light on this much appreciated.
    Other way around this is to default the 'From to' field to the email address where the replies are always required, can this be done? I know you can select the 'From to' from a list but this should not be necessary.
    Thanks

    Hi,
    According to your description, you'd like to achieve that, all your emails which you would receive will go to find another address.
    If yes, we can depend on Outlook rule or transport rule.
    Outlook rule:
    Transport rule:
    The recipient is(http://technet.microsoft.com/en-us/library/dd638183(v=exchg.150).aspx )
    Redirect the message to(http://technet.microsoft.com/en-us/library/aa998315(v=exchg.150).aspx )
    If I misunderstand your meaning, please feel free to let me know.
    Thanks,
    Angela Shi
    TechNet Community Support

  • Dynamic rows in TableView Iterator

    Hello All,
    I am developing an application in which there would be a TableView with last column as a button. OnClick event on the button should add the row below the current row (the facility should be like an Excel spreadsheet where we can insert the rows below). Can it be acheived by re-populating the internal table which his attached with TableView Control.
    Is it Ok to use TableView in such a condition or we have to go with pure HTML tables or some kind of ActiveX controls?
    Thanks in advance.
    Thanks And Regards
    Rajeev Patkie

    Hallo Rajeev,
    > Is it Ok to use TableView in such a condition...
    It is OK to use the tableView as long as it works for you! Once we run into problems, then of course one has to see if the functionality is "working as designed" and whether it was designed to handle your specific request.
    However, what you want to achieve sounds relatively harmless. Just use onclick on the button to trigger a server round trip. (Nice idea: write the row index directly into the onclick string!). Then add a new empty row into your at the correct index (see ABAP documentation), and just render table new.
    All of this should be relatively easy. Why don't you try, and let us see what you achieve.

Maybe you are looking for

  • New WD HD isn't showing up in Installer Disk Utility?

    I've checked the connections numerous time and everything is properly installed. I inserted the installer cd that came with my laptop and the HD doesn't appear in disk utility so there is no way for me to format it. The only thing that does pop up ho

  • Get the Coordinates of a Character in a TextArea

    Is there a way to determine what the coordinates of a given character are in a TextArea control? One project I'm working on presents a chunk of text cut off at some number of characters, followed by a LinkButton control (e.g., to view "more"), and I'

  • How to batch change filenames in iPhoto 09?

    I have a dilema... The photos I've taken with my Leica have a certain filename convention (e.g. L0001, L0002, etc.) and the photos I've taken with my Canon have a different filename convention (e.g. IMG_0001, IMG_0002, etc.). When I import these phot

  • Template title problem

    hi i have designed a dreamweaver template which has a main content editable region and another region further up which i want to include the title in. Therefore this piece of code i made as follows: <head> <link rel="stylesheet" type="text/css" href=

  • Color and Color Management boxes in Print Settings greyed out. Using PS CS5.1 with Mac OSX 10.9.5.

    For some reason, the above boxes are now greyed out when I go to Print Settings and I am getting prints that are badly distorted. Was working perfectly a few days ago and can't understand why this has suddenly happened ?  Am now confused as to what s