Problem using a Boolean variable

Greetings;
I'm writing a game in which the player and 'enemies' fall off the screen when they 'die'. The problem is that I also want to constrain their  movement to within the screen boundaries whenever they have not been killed. To start  I thought I'd go into the class I wrote to handle the player falling off the screen when he's touched by an enemy and create a boolean variable so that Flash would know to let him fall off the screen when killed, but remain constrained on the screen until that point.The problem is that now the player stays on the screen even when I want him to fall off (i.e. after he's been hit).
The class I wrote to handle the player dying is below, and the boolean variable is called 'playerBeenHit'. Since the player only gets a y acceleration when hit, I tried using the 'ay' variable to control the behavior but with the same results. In troubleshooting I tried to trace(playerBeenHit) on every frame and noticed it would go to 'true' and then set itself back to 'false' for three out of four readouts even after the player was hit. I'm not sure what I'm doing wrong here.
Thanks,
Jeremy
package  jab.enemy
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.geom.ColorTransform;
    public class DieLikeAPlayer
        private var _clip1:MovieClip; // the 'player'
        private var _clip2:MovieClip; // the 'enemy' who kills the 'player' on contact.
        private var ay = 0; // vertical acceleration for falling off the screen.
        private var vx = 0; // horizontal initial velocity, 'knockback' from the impact.
        private var vy = 0; // vertical initial velocity, 'knockback' from the impact.
        private var playerBeenHit:Boolean = false;
        public function DieLikeAPlayer(clip1:MovieClip, clip2:MovieClip): void
            _clip1 = clip1;
            _clip2 = clip2;
            _clip1.stage.addEventListener(Event.ENTER_FRAME, onEnterFrame)
            function onEnterFrame(event:Event):void
                if (_clip1.hitTestObject(_clip2)) // what happens when the player gets killed.
                    playerBeenHit= true;
                    ay = 3;
                    _clip1.scaleY = -Math.abs(_clip1.scaleY);
                    _clip1.alpha = 0.4;
                    _clip1.gotoAndStop(2);
                    vx = -0.2;
                    vy = 2;
                    _clip1.y += 5;
                    _clip1.rotation = -45
                // adding y acceleration and x velocity (knockback) from being hit.
                _clip1.x += vx;
                _clip1.y += vy;
                vy += ay;
                if(playerBeenHit == false)//constrains the player from moving past the  bottom of the screen.
                     if(_clip1.y > 620)
                     {_clip1.y = 620;}
                if (_clip1.y > 100000) // brings the player 'back to life' after falling 100,000 pixels.
                    ay = vx = vy = 0;
                    _clip1.alpha = 1;
                    _clip1.scaleY = Math.abs(_clip1.scaleY);
                    _clip1.rotation = 0;
                    _clip1.gotoAndStop(1);
                    _clip1.x = 480;
                    _clip1.y = 300;
                    playerBeenHit = 0;

that shouldn't compile.  don't you see an error message about your boolean being assigned an int?  you are publishing for as3, correct?

Similar Messages

  • Use of boolean variables in BPEL switch statements

    I have a workflow with a single boolean input parameter:
    <element name="input" type="boolean"/>
    I wish to use a switch statement within the workflow, based on the value of that boolean parameter.
    When I use the following XPath expression:
    bpws:getVariableData("input","payload","/tns:BooleanRequest/tns:input")
    I get the correct functionality, although I get the following BPEL compiler warning:
    " [bpelc] [Warning ORABPEL-10078]: return value of this expression may not be a boolean
    [bpelc] [Description]: in line 35 of "C:\eclipse\workspace\Boolean\Boolean.bpel", xpath expression "bpws:getVariableData("input","payload","/tns:BooleanRequest/tns:input")" used in <switch> may not return boolean type value, the xpath engine would automatically try to convert the return value to boolean..
    [bpelc] [Potential fix]: Please use one of the built-in boolean functions from xpath http://www.w3.org/TR/xpath#section-Boolean-Functions to convert the return value to boolean.."
    However, the boolean functions referenced do not appear to be relevant to a variable which is already of a boolean type. If I attempt to use the boolean() function in my XPath expression, I get rid of the compiler error, but the workflow now does not work as required.
    How can I get rid of the compiler warning and still get the required functionality, and/or am I doing the wrong thing?
    I am currently running on JBoss, with BPEL release 2.1.2 [build #1226].
    Thanks for any help or ideas.

    Hi Marlon,
    Thanks for that - I guess we have to accept the vagaries of XPath and the absence of type-checking for variables.
    I hadn't fully understood until I started investigating that I can assign ANY string to variable of type xsd:boolean, which has been the cause of some of the confusion for me - whether that value is then considered true or false depends on how you write your test condition.
    I tried with your condition, and it didn't seem to work (evaluated to true if the variable data was the string "true()", but otherwise it seemed to always evaluate to false.
    I also tried the following:
    condition="bpws:getVariableData('booleanVariable')=true()"
    but that evaluates to true for any string of length > 0.
    The only one I can get to consistently work is:
    condition="bpws:getVariableData('booleanVariable')=string(true())"
    although that means that variable data of "TRUE" will evaluate to false (may well be the correct behaviour, depending on how you're setting the boolean variable in the first place).

  • Problem: Use an ODI variable in a Java Procedure

    Hi and thanks in advance,
    i need to use a project variable in a java procedure i've written. In particular i should read a file (and manage it...), but its name is stored in avariable called #fileName that i refresh each time.
    writing something like:
    <% FileInputStream fis = new FileInputStream(C:\\"+"#filename");
    etc.
    etc.
    %>
    doesn't work...
    How can i use the value of my ODI variable inside the Java code?
    Please, help me if you can...
    Thank you very much.

    Any Idea? Please, this question is blocking me...

  • Problem Using a Bind Variable on a SelectOneChoice List VO

    Hi everyone,
    I have a List View Object on my application that contains the lookup values for some combos. The underlying table has three columns: LOOKUP_TYPE, LOOKUP_CODE and DESCRIPTION. It is used like this: when i want to find out which are the possible values for the "Customer Status" field on a form, i need to execute this VO with LOOKUP_TYPE = "CUST_STATUS". when i want to find the Supplier status, i execute it with "SUPP_STATUS". Then i compare the value of LOOKUP_CODE with the customer_status or supplier_status codes to get its description.
    The problem is, i have to use this VO as the Dynamic List of values for a SelectOneChoice. I have correctly mapped it, but the VO query is like this:
    SELECT lookup_code, description FROM tab_lookup_codes WHERE lookup_type = :lkpType
    So i need to set the bind variable dinamically, as i would do with ExecuteWithParams, but for a SelectOneChoice list. How can i do such thing? is there a way to define a value for this parameter before ADF executes the List VO on the page definition, or even programatically?
    If you didn't understand my requirement, please let me know.
    Thank you very much for your time!
    Thiago Souza

    Hi Thiago,
    If i understand you problem you can try to insert a invokeAction to your page definition with refresh property equals prepareModel that call a method that sets your Where param propertly. In this way your method will be executed before prepareModel.
    I haven't test this, its only a possible idea.
    Best Regards
    Hi everyone,
    I have a List View Object on my application that
    contains the lookup values for some combos. The
    underlying table has three columns: LOOKUP_TYPE,
    LOOKUP_CODE and DESCRIPTION. It is used like this:
    when i want to find out which are the possible values
    for the "Customer Status" field on a form, i need to
    execute this VO with LOOKUP_TYPE = "CUST_STATUS".
    when i want to find the Supplier status, i execute it
    with "SUPP_STATUS". Then i compare the value of
    LOOKUP_CODE with the customer_status or
    supplier_status codes to get its description.
    The problem is, i have to use this VO as the Dynamic
    List of values for a SelectOneChoice. I have
    correctly mapped it, but the VO query is like this:
    SELECT lookup_code, description FROM tab_lookup_codes
    WHERE lookup_type = :lkpType
    So i need to set the bind variable dinamically, as i
    would do with ExecuteWithParams, but for a
    SelectOneChoice list. How can i do such thing? is
    there a way to define a value for this parameter
    before ADF executes the List VO on the page
    definition, or even programatically?
    If you didn't understand my requirement, please let
    me know.
    Thank you very much for your time!
    Thiago Souza

  • Problem using '--' on a variable via a pointer

    Hello.
    I'm new to C (been learning just over a week now), so if you take the time to reply - please don't pitch the answer too high!
    I've just finished work on my latest project - a Sudoku Solver. It only does simple puzzles, but it (finally) works.
    Here's a basic run-down of what it does: a user enters the known numbers of a Sudoku grid, line by line, and the program assigns these to an array (if the number is unknown, the relevant part of the array is set to zero). The array also holds a 'possibles' value for each cell, which says how many numbers are still potential values for that cells (so, when the user's input is first translated into the array, this value will be nine for an empty cell).
    A series of structs are then set up, one per cell, which hold various bits of information about each cell. The main things are the coordinates for each cell, together with whether each number (one to nine) is a possibility for that cell, and the total number of possibilities for that cell (which is a pointer to the 'possibles' value in the array, mentioned earlier).
    The solving loop is split into two parts. The first goes through each struct, and determines whether the value for that cell is known or not. If it is, that value is removed as a possibility for each cell in its row, column, and box.
    The second part of the loop goes through all cells and, if only one possibility exists for a cell, assigns that as the final answer in the array. The solving loop then continues until all cells are solved.
    My problem came when reducing the 'possibles' value for a cell in the array, via the struct. My first attempt used this line:
    *mySudoku[j].possibles--
    ('mySudoku' is the name of the struct type; 'j' is a value (0-81), and 'possibles' is a field that points to the value in the array that holds how many potential answers there still are for that cell). In my mind, that code snippet should point at the address held in that struct's field, and reduce it by one.
    After much banging of head against a wall, I discovered that the above code snippet wasn't doing the same as:
    *mySudoku[j].possibles = (*mySudoku[j].possibles)-1
    Once I'd changed the code over, the program worked like a dream.
    My question is: why aren't those two bits of code doing the same thing? I've obviously misunderstood something fairly basic, but I can't understand what.
    If any of my explanation isn't clear, then please let me know and I'll clarify.
    Thanks for your time,
    Pete.
    Message was edited by: Pete_M2

    Pete_M2 wrote:
    *mySudoku[j].possibles--
    *mySudoku[j].possibles = (*mySudoku[j].possibles)-1
    My question is: why aren't those two bits of code doing the same thing? I've obviously misunderstood something fairly basic, but I can't understand what.
    In a word, precedence. The first operation performed is the array subscript. Then the member selection via ".". Next is postfix decrement. The pointer dereference is done last.
    You should probably use parentheses to clearly specify the order in which you want operations to be performed. I am and have always been virtually clueless about precedence. I always use parentheses to clearly indicate what I want to be done. Even if they are redundant, they still help to clarify the situation.
    I would have written the above code as:
    --(*mySudoku[j].possibles)
    I would use prefix decrement because I don't need the pre-decrement value. I use the parentheses for clarity even though they supposedly aren't needed with prefix decrement. I say "supposedly" because I really have no clue. I have been programming for 20 year and the only precedence I know is parenthesis trumps all (usually).

  • Problem using local variable in event loop

    I have a state machine from which I want to monitor various controls, including "Start" and "Stop" buttons.  Not every state needs to monitor the controls.  At present, most states run timed loops.  In the first state that reads the front panel, I have an Event structure (inside a While loop) that monitors the various controls' Change Value events.  For numeric controls, I update variables (in shift registers) as needed.  The "Start" button is used to end the While loop controlling the Event structure, allowing the State to exit to the next state.
    My problem comes in subsequent states that employ this same idea.  Here, I put a Local Variable bound to the Start button and use the same code, but it frequently happens that when I enter this particular state, I cannot "turn on" the control -- I push the button, but it stays off.  Curiously, if it was On when I enter, I can turn it off, but then I'm stuck not being able to turn it on.
    I mocked up a very simply routine that illustrates this.  There are two sequences (corresponding to the two states).  Both use an Event loop with a local variable bound to my Stop button (really this is an LED control with custom colors).  I've deliberately moved the "initialization" (the declaration of the control in the block diagram) out of the Event loops -- putting it inside the first loop modifies the behavior in another strange way.
    Here's my thinking on how I would expect this to work:  The code outside Event Loop 1 should have little effect.  Assume the Stop button is initially Off.  You will "sit" in Event Loop 1 until you push the Stop button, changing its value to True; this value will be passed out of the Event case and cause the first While loop to exit.  You now enter the second sequence.  As I understand the Exit tunnel, it defaults to "False", so I'd expect to stay in the second Event loop until I turn the Stop button from On to Off, which will pass out a False, and keep me in the While for one more button push.  However, this doesn't happen -- I immediately exit, as though the "True" value of the Stop local variable is being seen and recognized by the Event loop (even though it hasn't changed, at least not in the context of this second loop).
    An even more curious thing occurs if I start this routine with the Stop button turned on.  Now I start in my Event loop waiting for a change, but this time the change will be from On to Off, which won't cause an exit from the frame.  This will be reflected by having the While loop count increment.  We should now be in the state of the example above, i.e. in an Event loop waiting for the control to be pushed again, and turned On.  However, clicking the control has no effect -- I cannot get it to "turn on".
    Where am I going astray in my thinking?  What is it about this method of doing things that violates the Labview paradigm?  As far as I can tell, what I'm doing is "legal", and I don't see the flaw in my reasoning, above (of course not -- otherwise I'd have fixed it myself!).  Note that because I'm using local variables inside Event loops (and I'm doing this because there are two places in my code where I want to do such testing), the Stop control is not latching (as required).  Is there something that gets triggered/set when one reads a latched control?  Do I need to do this "manually" using my local variable?
    I'll try to attach the simple VI that illustrates this behavior.
    Bob Schor
    Attachments:
    Simple Stop Conundrum.vi ‏14 KB

    altenbach wrote:
    Ravens Fan wrote:
    NEVER have multiple event structures that share the same events. 
    Actually, that's OK.  NOT OK is having multiple event structures in the same sequence structure.
    See also: http://forums.ni.com/ni/board/message?board.id=170&message.id=278981#M278981
    That's interesting.  I had always thought I read more messages discouraging such a thing rather than saying it was okay.  Your link lead me to another thread with this message. http://forums.ni.com/ni/board/message?board.id=170&message.id=245793#M245793.  Now that thread was mainly concentrating on registered user events which would be a different, but related animal. 
    So if you have 2 event structures they each have their own event queue?  So if you have a common event, one structure pulls it off its event queue and it does not affect the other structure's event queue?  I guess the inherent problem with this particular VI was that the second event structure locked the front panel.  Since the code never got to that 2nd event structure because the  first loop never stopped because the change was from true to false.  After reading your post and the others, I did some experimentation and turned off the Lock front panel on the 2nd structure, and that prevented the lockup of the program.
    Overall, the example VI still shows problems with the architecture and I think your answer should put the original poster on the right track.  I think as a rule I would probably never put the same event in multiple structures, I feel there are better ways to communicate the same event between different parts of a program,  but I learned something by reading your reply and about how the event structures work in the background.  Thanks.

  • Process Integrator Problem (use of session bean variable between tasks)

    Hello,
    I'm having a problem using the Process Integrator. I made a
    really simple workflow (Start, Task1, Task2, Done) which uses
    the bean given whith the order processing example. Task1 creates
    the bean and executes a business operation (check inventory).
    Task2 executes another business operation (calculate total
    price). The problem is when I try to execute this second b.o I
    get an exception saying
    Nested exception is: Workflow error:
    com.bea.wlpi.common.WorkflowException: Empty instance object for
    business operation "Calculate Total Price" in
    template "Template3".
    Someone could help me and tell me what I am doing wrong.
    Thanks in advance,
    Albert

    If I understand you correctly, you have 3 business operations, one is "Create a EJB",
    one is call "Check Inventory", the other is "Caculate Total Price". I assume you
    save the EJB handle to a workflow variable with a type Bean. My speculation is when
    you define business operation for "Calculate Total Price", you did not associate
    it with the workflow variable that you saved the EJB handle. Just a wild guess.
    Jim Zhou.
    "Albert Lanchas" <[email protected]> wrote:
    >
    Hello,
    I'm having a problem using the Process Integrator. I made a
    really simple workflow (Start, Task1, Task2, Done) which uses
    the bean given whith the order processing example. Task1 creates
    the bean and executes a business operation (check inventory).
    Task2 executes another business operation (calculate total
    price). The problem is when I try to execute this second b.o I
    get an exception saying
    Nested exception is: Workflow error:
    com.bea.wlpi.common.WorkflowException: Empty instance object for
    business operation "Calculate Total Price" in
    template "Template3".
    Someone could help me and tell me what I am doing wrong.
    Thanks in advance,
    Albert

  • Problem using variables

    Hi,
    I'm having problems using different variables in captivate 4.
    I'm developing a courseware in Hebrew and I know there is a problem inputing hebrew strings into variables in captivate since there is no middle eastern version to the software, but I also having problems displaying system variables such as current date etc', and even inputting numbers into user variable.
    Would appreciate your help,
    Oren.

    Have you tried downloading and installing the Captivate 5.5 trial version and testing it with these Hebrew characters and variable issues?
    I know that Cp 5 and 5.5 have some support for double-byte Asian characters, so maybe they also have better support for Hebrew.
    Also, when you add a variable string using the $$ characters on each end, make sure there's a space between before the first $$ characters and after the final $$ characters enclosing the variable string.

  • Problems using a variable with a tag of a webapp

    I have a webapp where I've built a field in the database for the item is active or not, depending if my client chooses if it's free or not.
    The name of the tag that I want to use as a variable is { tag_estado } and has two values:
    Gratis
    Pago
    When in jQuery I create a variable to store the value of this tag and created a conditional to activate the link and icon of the item, always the tag value prints it on "Pago", even though the webapp item has the value of "Gratis"
    I appreciate your time to help me resolve this issue.
    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
              var linkleccionGratis = function() {
                        $(".linkLeccion").attr('href', '{tag_itemurl_withhost}?tab=video');
              var linkleccionPago = function() {
                        $(".linkLeccion").attr('href', '#dataaaaaaaa');
              var imagenGratis = function() {
                        $('.videoIcono').each(function(){
                              //Change the src of each img
                              $(this).attr('src', '/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_1.png');
              var imagenPago = function() {
                        $('.videoIcono').each(function(){
                              //Change the src of each img
                              $(this).attr('src', '/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_0.png');
        var EstadoLeccion = "{tag_estado}";
              if(EstadoLeccion == "Pago"){
                                  linkleccionPago();
                                  imagenPago();
              else if(EstadoLeccion == "Gratis"){
                                  linkleccionGratis();
                                  imagenGratis();
                        else{
                                  linkleccionPago();
    </script>
    <div style="width: 921px; margin-bottom: 10px;">
    <div class="FranjaSuperiorTituloLeccion">
    <div class="TituloContenedorLeccionWebApp">
    <div class="TituloLeccionWebApp">Lecci&oacute;n {tag_num_leccion}: {tag_titulo_leccion}</div> </div> <div class="ImagenesBotonesLeccionWebApp">
    <a class="linkLeccion" href="#data" id="inline"><img alt="Video" class="videoIcono" src="http://www.excelvirtual.org/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_ 0.png" style="margin-top: 6px; width: 31px; height: 31px;" />
    </a>
    </div>
    <div class="ImagenesBotonesLeccionWebApp">{tag_actividad url}</div>
    <div class="ImagenesBotonesLeccionWebApp">
    <a href="{tag_cuestionario}" target="_blank">
    <img alt="Cuestionario" src="http://www.excelvirtual.org/nuevodiseno/images/actividaddef2.png" style="width: 41px; height: 41px;" />
    </a>
    </div>
    </div>
    </div>

    It's tough to tell without seeing the page but it looks like your code may be defaulting to the else statement. You could delete the else and see if it does anything

  • Problem using the value of the variable in the KM options - Essbase Extract

    Hi,
    I am able to extract the data from Hyperion Essbase using the report script present in D:\ODIHome\oracledi\demo\hyperion.
    Instead of hardcoding the absolute file path in LKM options, I have requirement to use the value of variable, PIPHome and form the file path.
    So in LKM Options I gave Extraction Query File path as #GLOBAL.PIPHome \oracledi\demo\hyperion\extract.rep
    Its not able extract the data and throwing following exception.............Please help me in using the variable value in KM options. Thanks.
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 1, in ?
    com.hyperion.odi.essbase.ODIEssbaseException: Cannot execute report. Analytic Server Error(1030009): Name too long (#GLOBAL.PIP_HOME\oracledi\demo\hyperion\extract.rep) in ESSAPI function EssReportFile
         at com.hyperion.odi.essbase.ODIEssbaseDataReader.getAppData(Unknown Source)
         at com.hyperion.odi.essbase.AbstractEssbaseReader.extract(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
         at org.python.core.PyMethod.__call__(PyMethod.java)
         at org.python.core.PyObject.__call__(PyObject.java)
         at org.python.core.PyInstance.invoke(PyInstance.java)
         at org.python.pycode._pyx3.f$0(<string>:1)
         at org.python.pycode._pyx3.call_function(<string>)
         at org.python.core.PyTableCode.call(PyTableCode.java)
         at org.python.core.PyCode.call(PyCode.java)
         at org.python.core.Py.runCode(Py.java)
         at org.python.core.Py.exec(Py.java)
         at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
         at com.sunopsis.dwg.codeinterpretor.k.a(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(Unknown Source)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(Unknown Source)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(Unknown Source)
         at com.sunopsis.dwg.cmd.e.i(Unknown Source)
         at com.sunopsis.dwg.cmd.h.y(Unknown Source)
         at com.sunopsis.dwg.cmd.e.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: com.hyperion.odi.essbase.ODIEssbaseException: Cannot execute report. Analytic Server Error(1030009): Name too long (#GLOBAL.PIP_HOME\oracledi\demo\hyperion\extract.rep) in ESSAPI function EssReportFile
         at com.hyperion.odi.essbase.wrapper.EssbaseReportDataIterator.init(Unknown Source)
         ... 33 more
    Caused by: com.essbase.api.base.EssException: Cannot execute report. Analytic Server Error(1030009): Name too long (#GLOBAL.PIP_HOME\oracledi\demo\hyperion\extract.rep) in ESSAPI function EssReportFile
         at com.essbase.server.framework.EssOrbPluginDirect.ex_olap(Unknown Source)
         at com.essbase.server.framework.EssOrbPluginDirect.essMainReport(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMainMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMethod2(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMethod(Unknown Source)
         at com.essbase.server.framework.EssOrbPluginDirect._invokeProtected(Unknown Source)
         at com.essbase.api.session.EssOrbPluginEmbedded.invokeMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPluginEmbedded.invokeMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin.essMainReport(Unknown Source)
         at com.essbase.api.datasource.EssCube.report(Unknown Source)
         ... 34 more
    com.hyperion.odi.essbase.ODIEssbaseException: com.hyperion.odi.essbase.ODIEssbaseException: Cannot execute report. Analytic Server Error(1030009): Name too long (#GLOBAL.PIP_HOME\oracledi\demo\hyperion\extract.rep) in ESSAPI function EssReportFile
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(Unknown Source)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(Unknown Source)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(Unknown Source)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(Unknown Source)
         at com.sunopsis.dwg.cmd.e.i(Unknown Source)
         at com.sunopsis.dwg.cmd.h.y(Unknown Source)
         at com.sunopsis.dwg.cmd.e.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    Hi,
    If you are going to use variable as one of the options then what you can do is create a package.
    Drag your variable on to the package and set or declare it.
    Then drag your interface on to the package.
    Now when you execute the package it should make use of the variable.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • N-Queens Problem Using Stacks Help

    I'm trying to solve the N-Queens problem using Stacks. Quite frankly, I'm completely lost.
    Here's the pseudocode from the book:
    "Push information onto the stack indicating the first choice is a queen in row 1, column 1.
    success = false;
    while(!success && !s.isEmpty())
    Check whether the most recent choice (on top of the stack) is in the same row, same column, or same diagonal as any other choices (below the top). If so, we say there is a conflict: otherwise, there is no conflict.
    if (there is a conflict)
    -Pop items off the stack until the stack becomes empty or the top of the stack is a choice that is not in column n. If the stack is now not empty, then increase the column number of the top choice by 1.
    else if (no conflict and the stack size is n)
    -Set success to true because we have found a solution to the n-queens problem.
    else
    -Push information onto the stack indicating tat the next choice is to place a queen at row number s.size()+1 and column number 1.
    And here is my excuse for code so far. I have no idea how to check the diagonals, or how to even really make this work
    {code}import java.util.Stack;
    public class NQueens {
    int row, column, n;
    public NQueens(int n) {
    row = 0;
    column = 0;
    n = n;
    public Stack Solve(){
    boolean success, conflict;
    Stack<NQueens> Qs = new Stack<NQueens>();
    if (Qs.size() == 0)
    Qs.push(new NQueens(1));
    success = false;
    while (!success && !Qs.isEmpty())
    if (Qs.peek().row == row)
    conflict = true;
    if (Qs.peek().column == column)
    conflict = true;
    if (conflict = true)
    Qs.pop();
    Qs.peek().column += 1;
    else
    if (!conflict && Qs.size() == n)
    success = true;
    else
    Qs.push(new NQueens(Qs.size()+1));
    return Qs;
    {code}

    First off I'll address this:
        int row, column, n;
        public NQueens(int n) {
            row = 0;
            column = 0;
            n = n; //here
        }Notice the last line of that. I get what you're trying to do, but think about what the compiler sees there. If you have two variables called 'n', one at the class level, and one at the method level, the compiler must have rules so it knows which one you're talking about. And if it follows those rules, then saying 'n' inside that method must always refer to the same n. Otherwise, how would it decide which one you're talking about? The rule here is that it uses the most local variable available to it, which in this case is your method parameter. So 'n = n' is setting the parameter equal to itself. To refer to the class variable n, use "this.n", like so:
    this.n = n;Now that that's settled, let's address some logic. You'll need to figure out whether two Queens share a diagonal. I can think of at least a couple options for that. First, every time you look at a Queen you could loop through the entire board and make sure that if a piece is in r3c4, that no piece is in r2c3,r4c5,r5c6, etc. Or you could create a new variable for your class similar to your 'row' and 'column' variables that tracks the diagonal a piece is in. But that requires some calculating. And remember, there's 2 directions for diagonals, so you'll need 2 diagonal variables.
    If these are your Row and Column values:
    Row          Column
    00000000     01234567
    11111111     01234567
    22222222     01234567
    33333333     01234567
    44444444     01234567
    55555555     01234567
    66666666     01234567
    77777777     01234567And these are your diagonal values:
    Diag 1                    Diag 2
    0  1  2  3  4  5  6  7          7  6  5  4  3  2  1  0
    1  2  3  4  5  6  7  8          8  7  6  5  4  3  2  1
    2  3  4  5  6  7  8  9          9  8  7  6  5  4  3  2
    3  4  5  6  7  8  9  10          10 9  8  7  6  5  4  3
    4  5  6  7  8  9  10 11          11 10 9  8  7  6  5  4
    5  6  7  8  9  10 11 12          12 11 10 9  8  7  6  5
    6  7  8  9  10 11 12 13          13 12 11 10 9  8  7  6
    7  8  9  10 11 12 13 14          14 13 12 11 10 9  8  7Then examine the relationship between Row(R), Column(C), and Diagonals 1 and 2 (D1/D2):
    RC   D1,D2
    00 = 0,7
    01 = 1,6
    02 = 2,5
    03 = 3,4
    04 = 4,3
    05 = 5,2
    06 = 6,1
    07 = 7,0
    10 = 1,8
    11 = 2,7
    12 = 3,6
    13 = 4,5
    14 = 5,4
    15 = 6,3
    16 = 7,2
    17 = 8,1You'll notice that D1 is always the same as R + C. And D2 is always the same as C subtracted from 7 plus R, giving:
    int d1 = row + column;
    int d2 = (7 + row) - column;But remember, that 7 in the formula above, is based on how big your grid is. So whatever your 'N' is, whether its a 10x10 square or a 574x574 square, that 7 should be changed to (N-1)
    So those could be your variables to track diagonals. What I'm noticing in your current code, is that you never change your row and column variables...so every Queen is always at r0c0. You should probably put values for those in your parameters for the constructor, in addition to n. Then the diagonals can be calculated from those.
    Edited by: newark on Apr 17, 2008 10:46 AM

  • Problem using pdk-html:multibox and pdk-html:checkbox

    Hi all,
    I am developing a PDK struts application using OC4J 10.1.2. I have to create some form pages which are going to have some checkboxes. I have tried to follow the following code in order to use the pdk version of the checkbox in my form:
    in jsp file
    <logic:iterate id="item" property="items">
    <pdk-html:multibox property="selectedItems">
    <bean:write name="item"/>
    </pdk-html:multibox>
    <bean:write name="item"/>
    </logic:iterate>
    Given an ActionForm setup like this
    private String[] selectedItems = {};
    private String[] items = {"UPS","FedEx","Airborne"};
    public String[] getSelectedItems() {
    return this.selectedItems;
    public void setSelectedItems(String[] selectedItems) {
    this.selectedItems = selectedItems;
    ....... //getters and setters of items//
    In the reset method I also reinitialize the selectedItems array like :
    selectedItems=new String[]{};
    But the value of the multibox is not reflected in the action class. To my surprise, the html code generated by the server is similar to ordinary checkbox which ideally should carry some portlet specific information like pdk-html:text
    Same is the case with single checkbox. I have created a boolean variable for the single checkbox in the actionForm class. But same problem frustrates me again. The value is not passed simply.
    Can anybody comment. Is this some kind of a bug or may be there is no support for checkbox and multibox in pdkstruts.jar (10.1.2.0.2).
    Best regards,
    Omer

    following below the code that generate the XML. I still need help.
    I hope someone can help me in this issue
    The servlet that generate the XML.
    response.setContentType("text/xml");
    String Xml = "";
    Xml = Xml + "<?xml version=\"1.0\"?>";
    Xml = Xml + "<?xml-stylesheet href=\"/XslGravaCrit.xsl\" type=\"text/xsl\"?>";
    Xml = Xml + "<!-- Here is a sample XML file -->";
    Xml = Xml + "<page>";
    Xml = Xml + "<title>Test Page</title>";
    Xml = Xml + "<content>";
    Xml = Xml + "<paragraph>What you see is what you get!</paragraph>";
    Xml = Xml + "</content>";
    Xml = Xml + "</page>";
    try{
    TransformerFactory tFactory = TransformerFactory.newInstance();
    byte[] arr=Xml.getBytes();
    ByteArrayInputStream bytes=new ByteArrayInputStream(arr);
    Source xsl=new StreamSource("../XslGravaCrit.xsl");
    Templates template=tFactory.newTemplates(xsl);
    Transformer transformer = template.newTransformer();
    transformer.transform(new StreamSource(bytes), new StreamResult(response.getWriter()));
    }catch(Exception e){
    System.out.println("Excecao 100: " + e.getMessage() + e.getLocalizedMessage());
    The XSL XslGravaCrit.xsl
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
    version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:output method="html" indent="yes" version="4.0"/>
    <xsl:template match="page">
    <html>
    <body><b>
    <xsl:value-of select="java:java.util.Date.new()"/>
         </b>
    <xsl:for-each select="/page">
    <xsl:sort select="paragraph"/>
    <xsl:value-of select="paragraph"/>
    </xsl:for-each>
    <i>Hello World</i>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

  • Issue with use of shared variables in Crystal Reports 2008 Offline Viewer

    Hi,
    I have a report that contains a number of sub-reports which include drill-down functionality. The report returns data relating to an individual team with the user being able to view top level summary information in each area from the parent report and then drill into the sub-reports to view see more detail. The data returned by the sub-reports is filtered, using sub-report links, based on the team code parameter value given by the user. This parameter field resides in the main report.
    One of the values returned by the main report is the team name. This is passed to each sub-report using a shared variable and each sub-report displays this team name as part of a heading.
    This all works fine in Crystal Reports 2008, but when a report, containing data, is opened using Crystal 2008 Offline Viewer there is a problem with the shared variable. The value is displayed correctly when the user initially drills into the sub-report. However, when the user begins to drill into grouped data within the sub-report the value passed to the sub-report using the shared variable disappears. 
    How can I ensure that, when a report is viewed using Crystal Offline Viewer 2008, the value within the shared variable is not lost when users drill into grouped data within sub-reports
    Thanks
    Stuart

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • How can I use Server level variables in a business model based report

    hi gems..
    I have declared one server level variable in the BI Analytics repository.
    Now I have made one business model based report.
    In one column I want to use that server level varible.
    I go to the formula tab of that column and then clicked on variable--> session --> put the name of the variable and click ok.
    But when i viewed the report, it is not showing the dates, rather it is showing the date format I chosed i.e DD-MMM-YYYY.
    please help..

    actually the previous problem got resolved...
    Now when I am trying to apply a filter on a particular column using that server variable, then it is showing that the varible has no value definition.
    I have clicked on the filter tab of that column-->add-->variables-->session variables-->then I put the name of the variable-->click OK.
    the following error is comming-
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 23005] The repository variable, Variable_name, has no value definition. (HY000)
    I have made that server variable from manage-->variables-->(right click) create new initialisation block-->gave the name and wrote the query and aslo gave the connection pool name and test that and it worked fine..

  • Script logic - how to use a selection variable within an allocation logic

    Hi,
    I want to implement a simple top-down distribution to distribute values from a yearly budget (Y20xx.TOTAL) to a quarter budget (Q20xx.Q1, ... Q20xx.Q4) using the actuals of the previous year as reference.
    If we hard code the members it works fine:
    *RUNALLOCATION
    *FACTOR=USING/TOTAL
    *DIM ACCOUNT WHAT=ACC_NOT_ASSIGNED; WHERE=BAS(FIN); USING=<<<; TOTAL=<<<
    *DIM TIME WHAT=Y2009.TOTAL; WHERE=BAS(Q2009.TOTAL); USING=BAS(Q2008.TOTAL); TOTAL=<<<
    *DIM CATEGORY WHAT=SBO; WHERE=<<<; USING=ACTUAL; TOTAL=<<<
    *ENDALLOCATION
    Of course, we want to make this dynamic, using the values inputted in the selection screen of the package: time, entity and category.
    So if we start with write the following logic, it does not work anymore:
    *RUNALLOCATION
    *FACTOR=USING/TOTAL
    *DIM ACCOUNT WHAT=ACC_NOT_ASSIGNED; WHERE=BAS(FIN); USING=<<<; TOTAL=<<<
    *DIM TIME WHAT=%TIME_DIM%; WHERE=BAS(Q2009.TOTAL); USING=BAS(Q2008.TOTAL); TOTAL=<<<
    *DIM CATEGORY WHAT=%CATEGORY_DIM%; WHERE=<<<; USING=ACTUAL; TOTAL=<<<
    *ENDALLOCATION
    So, how to use the selection variables in this allocation logic? %TIME%, %CATEGORY% also did not work ...
    regards
    Dries
    solved it ...
    Edited by: Dries Paesmans on Feb 22, 2009 8:31 PM

    Hi Dries,
    Looks like you solved this, but if I can just add a small point -- when you use syntax like this:
    *DIM ACCOUNT WHAT=ACC_NOT_ASSIGNED; WHERE=BAS(FIN);
    *DIM TIME WHAT=Y2009.TOTAL; WHERE=BAS(Q2009.TOTAL);
    each time the logic runs, it will scan through the dimension from the FIN and Q2009.TOTAL members, one level at a time, until it reaches the base members (where calc = 'n'). This may happen very quickly, if the dimension has very few levels, but could take a bit of extra time if it's a particularly deep dimension. (By which I mean many levels of hierarchy -- not some 1970's Pink Floyd musical reference.)
    You may speed things up by using a member property instead of the BAS(xyz). Flag all the base members using a specific property value, and that way the logic engine can pick up the complete list of members in the WHERE clause, in a single query.
    *DIM Account What=ACC_NOT_ASSIGNED; Where=[FloydProperty]="DarkSideOfTheMoon"; ...
    This adds some maitenance work in the dimension, which may be problematic if your admins are changing it regularly (and will cause problems if they forget to update this particular property).
    I can't predict how much time this will save you (maybe not much at all), but anyway I figure you'd want to know exactly what work you're asking the system to perform.
    Regards,
    Tim

Maybe you are looking for