OBIEE + Essbase slow execution

Hi,
I'm using OBIEE version 10.1.3.4.1 and Essbase 9.3.1.3 as a data source. I have an Answers report with a certain number of columns that are using AGO, TODATE functions, etc and they work fine. Now I have a need for a column that would also implement a TODATE funcitionality, but for the previous year – for example, if I choose March 2009, I need to show aggregated data for January, February and March of *2008*.
Since I did not manage to get this just through the OBIEE functions that are available, the solution was to use the EVALUATE_AGGR function with the following expression:
EVALUATE_AGGR('AGGREGATE(PeriodsToDate(%1,%2.dimension.currentmember.lag(12)), %3)', Time.Year, Time.Month, Accounts.Sales).
Here I use the Essbase function “Lag” to shift the aggregation 1 year back (12 months).
This works fine, in that is gives the correct result, however it is very very slow when used in my report that gives cca. 18 columns and cca. 15 rows back as the result.
Does anyone know why is such report so slow, is it because of the Evaluate function, because of the Lag function or something else?
Any ideas?
thank you

Hey, thanks a lot for a quick answer!
You are right on both of your assumptions - multiple MDX are indeed fired and we do not have the possibility of chaning Essbase cubes.
Can you perhaps think of any other way of implementing this "todate for year ago" functionality?
Is there any way to control how OBIEE generates MDX? Hints maybe or something like that?
In addition to my first post, I would just like to add that the query is much much faster when I include, as a column in Answers, all the columns on which I apply a filter - example: I'm filtering by dimension "Segmentation", Generations 2 and 3 - when I don't have these coumns in the report itself so that the chosen segmentations are seen as a column, the report is very very slow (initial issue). But when I include them in the report (not just use them in filter), the report becomes very fast and would do fine for us as such. The problem is that I do not need to show the data 'divided' by segmentation (as it is when the columns are in the report, not just filter).
Edited by: ivo@cro on Mar 22, 2010 1:01 PM

Similar Messages

  • OBIEE Essbase skip-level hierarchy

    Is it possible to setup OBIEE and Essbase to be able to model skip-level hierarchy? It is obvious with connection to the relational database. How the essbase should designed and populated with data to faciliate this type of hierarchy?

    Refer this http://www.oracle.com/technetwork/middleware/bi-enterprise-edition/overview/obiee-essbase-modeling-guide-130897.pdf for Modeling. And for any Essbase releated question post it in Essbase forum Essbase

  • OBIEE-Essbase Federation Ques

    Hello All,
    We are doing federation b/w essbase and relational datasources. All our region level information (upto state) is in essbase and city level information is present in the relational tables for which drill down to city to fetch those details.
    The problem that I am facing here is with the Essbase Defaults. For the Time dimension in essbase, its defaulted to most recent month (Oct)
    So now in the report lets say you pulled state and dollars, that report will fetch from the cube for the most recent month. So far good but now when you drill to state, it wont pass the current month to the state. Is there a way to pass that current month to the city level SQL query.
    Well I guess this would be problem with every other dimension because of those essbase defaults. In this case of months, I would be able to create some default Current date variables or something and would be able to work it but for several other dimesions the defaults will always create me a problem
    I have a frequency dim(DLY, QTD, MTD, YTD) in essbase which is defaulted to 'DLY'. so how would I be able to pass the essbase defaults to relational queries??
    In the reports, we can use default values for dashboard prompts but was wondering how would we do it in ANSWERS?
    Please advice
    Thanks
    Prash
    Edited by: Prash11 on Oct 28, 2010 1:08 PM

    Refer this http://www.oracle.com/technetwork/middleware/bi-enterprise-edition/overview/obiee-essbase-modeling-guide-130897.pdf for Modeling. And for any Essbase releated question post it in Essbase forum Essbase

  • OBIEE - ESSBASE   ERROR - 1200467 - Error executing formula for [MDX query]

    I have an issue on essbase with a query with 50 member filters.
    The environment is OBIEE 11g over ESSBASE 11.1.2 with an ASO cube.
    The user for essbase are with database access filters.
    I have the following issue, OBIEE returns a query that filter 30 members and the query runs ok, but the same query with a 50 member filter returns the following error when i execute it on MAXL :
    MAXL Error
    ERROR - 1200467 - Error executing formula for [MDX query]: status code [1130203] in function [].
    ERROR - 1241101 - Unexpected Essbase error 1200467.
    i paste an example of the query that returns OBIEE
    With
    set [_Account2] as '{Distinct({[Account].[Allocated FTE - Budget]})}'
    set [_Employee0] as '[Employee].members'
    set [_Fund4] as 'Generate([Fund].Generations(2).members, Descendants([Fund].currentmember, [Fund].Generations(4), leaves))'
    set [_Position4] as '{Distinct({[Position].[POS111165], [Position].[POS111166], [Position].[POS111167], [Position].[POS111540], [Position].[POS112331], [Position].[POS113201], [Position].[POS113247], [Position].[POS113248], [Position].[POS113540], [Position].[POS113618], [Position].[POS113954], [Position].[POS114109], [Position].[POS114194], [Position].[POS115224], [Position].[POS115912], [Position].[POS115913], [Position].[POS116727], [Position].[POS117229], [Position].[POS117491], [Position].[POS117587], [Position].[POS117610], [Position].[POS117979], [Position].[POS119456], [Position].[POS121262], [Position].[POS121458], [Position].[POS121698], [Position].[POS123368], [Position].[POS124027], [Position].[POS124028], [Position].[POS124110], [Position].[POS124396], [Position].[POS125623], [Position].[POS125624], [Position].[POS126476], [Position].[POS127960], [Position].[POS129352], [Position].[POS129468], [Position].[POS129494], [Position].[POS129535], [Position].[POS129608], [Position].[POS129679], [Position].[POS129730], [Position].[POS129905], [Position].[POS130010], [Position].[POS130144], [Position].[POS133456], [Position].[POS134943], [Position].[POS135231], [Position].[POS135404], [Position].[POS135734]})}'
    set [_Program3] as 'Generate([Program].Generations(2).members, Descendants([Program].currentmember, [Program].Generations(3), leaves))'
    select
    { [Budget Item]
    } on columns,
    NON EMPTY {crossjoin({[_Account2]},crossjoin({[_Employee0]},crossjoin({[_Fund4]},crossjoin({[_Position4]},{[_Program3]}))))} properties GEN_NUMBER, [Account].[MEMBER_UNIQUE_NAME], [Account].[Memnor], [Program].[MEMBER_UNIQUE_NAME], [Program].[Memnor], [Employee].[MEMBER_UNIQUE_NAME], [Employee].[Memnor], [Fund].[MEMBER_UNIQUE_NAME], [Fund].[Memnor], [Position].[MEMBER_UNIQUE_NAME], [Position].[Memnor] on rows
    from [BCPSASO2.BCPS_ASO]
    any suggestions ?
    Thanks
    Niko
    Edited by: user8367101 on Mar 1, 2011 10:31 AM

    Here it is:
    It is a Windows Server 2003 R2
    Processor 8393 SE
    31.9 GB of RAM
    32-Bit
    How does "memscaling" works?
    I also think that are high but it is the way it was configured before I managed the application. For my DB
    Index Cache setting: 205800
    Index cache current value: 205800
    Data file cache setting: 33768
    Data file cache current: 0
    Data Cache setting: 877273
    Cata cache current: 71540
    Block Size: 65408

  • MODBUS/TCP very slow execution

    Dear all
    We are new user to Labview and to LabVIEW forum.
    We are designing a LabVIEW application that interacts with PLCs.
    We are trying to exchange information between a PC/labview and a PLC. Both support the MODBUS/TCP protocole. We have designed the 2 programs easily, the PC/LabVIEW one being easily made with VI Library.
    We first the PC/LabVIEW as a cleint and the PLC as server and it works perfect. It is quite fast as it takes less than 1 second.
    We test the reverse configuration ie PLC as client and PC/LabVIEW as server. Of course we use different programs there and monitor the MODBUS/TCP frames with WireShark.
    It works also but the execution on the PC/LabVIEW is very long (in the debug mode) : it takes 5 secondes to execute the Write Multiple Register function ( 2 data to write) to prepare the response frame and to send it back. It is very nice to see the animation on the diagram but why is it so long ? This long time frame is a very big problem for our application.
    We re not sure to know where to dig in !
    Thank you in advance for your help.
    Regards
    Thierry

    It sounds like you need to learn more about the LabVIEW development environment if you were confused about the slow speed of highlight execution.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • MYSQL slow execution of CF 7x

    I have an issue that is rather irritating. I'm playing
    around with MYSQL 5.0 on my laptop with Coldfusion 7x
    developer edition. I'm using the J-connector 5.0.3.
    It's a duo core 1.8 processor with 1 gig of ram. Any
    time I include a query of any size accessing tables
    with less than 20 records it can take up to 3 seconds
    on the debug info. The tables are all properly indexed
    and keyed. I've hit several sites and forums to
    determine if anyone else is having the issue I am.
    They all say things are running fine.
    Most queries say 0 msec which is right but after CF
    processes the cfincluded query it adds about 3 seconds
    on the execution. I'm thinking maybe the database and
    the cf server might be fighting over the bus to the
    CPU. I just don't know. Have you experienced anything
    like this?

    David, I'm experiencing the same problem. And it's not a
    problem with the table joins. I am running a CF/JSP environment and
    I run the exact same queries using the exact same driver, and only
    experience the problems with CF, the queries run fast in JSP. Mind
    you, this is only occurring with MySQL 5 as previous versions of
    MySQL ran fine with CF.
    Has anyone experienced massive slow down when using MySQL 5
    and CF7?
    Here are the environments I've tested. I've gotten the same
    slow response with each one (up to 5 seconds to return an empty
    query)
    CF7/Tomcat with MySQL 5 with Connecter/J 5.0
    CF7/Tomcat with MySQL 5 with Connecter/J 3.1.10
    CF7/IIS with MySQL 5 with Connecter/J 5.0
    CF7/IIS with MySQL 5 with Connecter/J 3.1.10
    CF7/IIS with MySQL 5 with ODBC/3.5.1
    CF7/IIS with MySQL 5 with ODBC/5.0
    In each case I've gotten the same results. I've installed on
    multiple machines, all running Windows and CF 7, MySQL 5 and Tomcat
    5.5 running on the same local server.
    Any help would be much appreciated.

  • OBIEE - Essbase / HFM

    Hi All,
    This might be a very basic question. We are looking at purchasing OBIEE for our Oracle ERP reporting needs and we also want to eventually have Essbase and HFM data within OBIEE.
    I am a bit confused on whether or not I need to import my Essbase cubes into OBIEE in order to use it or if it can remain outside of OBIEE and still be a datasource. And if you can do both, what are the pros and cons of storing it within OBIEE as opposed to having it sit outside. My understanding was that I had to physically build the Essbase cubes within OBIEE in order to use that data so, in essence, I would have Essbase stored twice; once in its regular cubes and once as another set of tables within OBIEE. But I have heard otherwise as well. Some clarification would be great.
    Does the same go for HFM? Stored twice?
    Much Appreciated,
    Mike

    Hi Mike,
    You will not need to import your Essbase cubes into OBIEE. OBIEE does not store data anywhere, it only acts as a query engine based on the metadata information you provide. This means that when OBIEE needs to show data from your Essbase cubes, it will connect to Essbase and directly query the cube.
    The only data stored in OBIEE is when it caches results, but this is done internally in OBIEE.
    Regarding HFM, OBIEE can also connect to HFM as a data source.
    Regards,
    Henrik

  • Slow Execution Time of Exponentia​l Function

    Hi,
    I am developing a program with large dataset (arrays size of around 1000*1000 elements).
    I realised that my program ran quite slow when calculating exponential for each array elements.
    So, I built a simple porgram to test the execution time for exponential vs multiplication on 1000*1000 array elements and found
    out that the period is ~25 times longer. Attached is the program (Labview 2011).
    The specs of my system are:
    1) Windows 7
    2) Intel i5 3Ghz with 4gb ram
    3) Labview 2011
    The actual program I built has a version in Matlab and uses exponential function as well. However, the execution time in Labview is around 10 times longer than the Matlab. I believe that the exponential function is the cause of this after making some analysis using built-in "Performance and Memory" tool and modification to the program.
    Is there any way I could make the exponential function runs faster? Or any better way to handle large array operation? (I have tested array operations with nested FOR loops and paralel execution but the results is not that great.
    Hope anyone can help. Thanks for any input.
    Attachments:
    Execution Time-Exponential Function.vi ‏11 KB

    Thank you for your answer. 
    I am sorry, I could not upload the real code since it is large and has lots of dependency. But, I wrote simple program both in Labview and Matlab as attached.
    I tried to make both program doing the same thing and put each element as random number between 0-1 to avoid any folding/optimization process.
    The Labview took around 974ms to complete the task while the matlab 177ms. If the the way I implemented them are correct, the Matlab is around 5 to 6 times faster than Labview to execute Exponential function.
    Attachments:
    Matlab Exponential Test.PNG ‏19 KB
    Labview Exponential Test.PNG ‏24 KB
    Exponential Test.vi ‏10 KB

  • Slow execution of a event structure(​Calling VI)

    The VI i created is gettin slow after execution of a particular set of event in an event structure(Calling VI).Is it because of improper use of shift register?
    I have attatched the VIs...Please run GUIdev and suggest solutions.Its really gettin on my nerves.
    Attachments:
    GUIFDR.zip ‏88 KB

    Hi altenbach
    Thanks for finding ways to optimize the code...but i have a few doubts.
    CPU burner:I took care of the cpu burner condition.I jst called those for trying out t main VI.I will be replacing those VI with developed ones.
        * Why are you bundling and then immediately unbundling all these pictures?
         Ans:chgd it
        * You have many overlapping objects on the front panel. Not good for performance.
         Ans:I am making a GUI so i thk i have no other choice but to overlap them.Also is there ny way to remove the frame from the picture box.I have just minimized and kept it.
        * Use an array of paths and index the desired element instead of reading via value property nodes.
         Ans: Can u site an eg for it..i dnt hav tht level of experience
        * There is no event for the stop button.
           Ans:Is it necessary?I will be modifying it in the future.
        * You don't need the timeout event.
           Ans: Modified it
        * Lots of near duplicate event cases. Once instance of each is enough, simply use control references.
           Ans:Each event case is either for moving out,moving in or clicking of the sliding button.How do i use a control referece for it?
        * Lots of duplicate code for the pictures and paths. Use an array of names, autoindex it on a FOR loop, and use only one copy of the code fragment.
          Anslease site an example so i can follow suite.
        * You seem to insert a VI at every iteration of the loop. Is this really necessary?
         Ans:Actually i wanted to insert a Vi only on the mouse down event, and continue running the same VI even if other mouse events take place.But i cant thk of a logic to avoid thm.But i really need a solution for tht.
    Can you explain in a bit more detail what you are actually trying to achieve with all this? Thanks! :
    My Vi as u can see is a GUI for downloading data from a hard disk and viewing and modifying the video and audio data.I will be interfacing the video and audio part later on as it is still being developed by my frnds.
    Also the problem of inserting a VI at every iteration is goig to pose a problem in the future as i want  to load each VI only for mouse clicks and let it run for all other instances.
    Please help me out
    regards
    Sankar

  • SQL query with Bind variable with slower execution plan

    I have a 'normal' sql select-insert statement (not using bind variable) and it yields the following execution plan:-
    Execution Plan
    0 INSERT STATEMENT Optimizer=CHOOSE (Cost=7 Card=1 Bytes=148)
    1 0 HASH JOIN (Cost=7 Card=1 Bytes=148)
    2 1 TABLE ACCESS (BY INDEX ROWID) OF 'TABLEA' (Cost=4 Card=1 Bytes=100)
    3 2 INDEX (RANGE SCAN) OF 'TABLEA_IDX_2' (NON-UNIQUE) (Cost=3 Card=1)
    4 1 INDEX (FAST FULL SCAN) OF 'TABLEB_IDX_003' (NON-UNIQUE)
    (Cost=2 Card=135 Bytes=6480)
    Statistics
    0 recursive calls
    18 db block gets
    15558 consistent gets
    47 physical reads
    9896 redo size
    423 bytes sent via SQL*Net to client
    1095 bytes received via SQL*Net from client
    3 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    55 rows processed
    I have the same query but instead running using bind variable (I test it with both oracle form and SQL*plus), it takes considerably longer with a different execution plan:-
    Execution Plan
    0 INSERT STATEMENT Optimizer=CHOOSE (Cost=407 Card=1 Bytes=148)
    1 0 TABLE ACCESS (BY INDEX ROWID) OF 'TABLEA' (Cost=3 Card=1 Bytes=100)
    2 1 NESTED LOOPS (Cost=407 Card=1 Bytes=148)
    3 2 INDEX (FAST FULL SCAN) OF TABLEB_IDX_003' (NON-UNIQUE) (Cost=2 Card=135 Bytes=6480)
    4 2 INDEX (RANGE SCAN) OF 'TABLEA_IDX_2' (NON-UNIQUE) (Cost=2 Card=1)
    Statistics
    0 recursive calls
    12 db block gets
    3003199 consistent gets
    54 physical reads
    9448 redo size
    423 bytes sent via SQL*Net to client
    1258 bytes received via SQL*Net from client
    3 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    55 rows processed
    TABLEA has around 3million record while TABLEB has 300 records. Is there anyway I can improve the speed of the sql query with bind variable? I have DBA Access to the database
    Regards
    Ivan

    Many thanks for your reply.
    I have run the statistic already for the both tableA and tableB as well all the indexes associated with both table (using dbms_stats, I am on 9i db ) but not the indexed columns.
    for table I use:-
    begin
    dbms_stats.gather_table_stats(ownname=> 'IVAN', tabname=> 'TABLEA', partname=> NULL);
    end;
    for index I use:-
    begin
    dbms_stats.gather_index_stats(ownname=> 'IVAN', indname=> 'TABLEB_IDX_003', partname=> NULL);
    end;
    Is it possible to show me a sample of how to collect statisc for INDEX columns stats?
    regards
    Ivan

  • Problem with slow execution on a cFP-2120

    I have an application that runs on a cFP-2120, using web interface for the user to interact with the program.
    I have noticed that in order to get the web interface to get updated I have to use property nodes and write to the value property, see this article:
    http://digital.ni.com/public.nsf/allkb/FC5024A5DD6344C886256C8C0054689B?OpenDocument
    However, this seems to give me a serious performance hit, as described here:
    http://forums.ni.com/ni/board/message?board.id=170&thread.id=153531&view=by_date_ascending&page=1
    I have tested with this code, and with my LV 8.2 a loop that uses 277ms to complete when writing directly to a indicator will use 203159ms when using a property node.
    So, I need to update several front panel objects using the value property, but can't afford the cpu time. Does anyone have a suggestion how to do this as efficiently as possible? The problem is apparantly that using the value property requires the front panel to be loaded - can I for instance avoid doing this once for each variable?

    I've changed the vi now so it only writes to value property when a value has changed. This has cut execution time in half, from 500ms to 250ms. I still think this is quite a lot...
    To give you an indication of "size", the executeable is 1210kb with 2 dll's of 872 and 168kb.
    I've not tried deploying a smaller (cut down?) version - what exactly do you mean?
    With regards to writing to value instead of locals or directly - I've had problems with the values not updating - but not always - and the first link does suggest a bugfix. I'd like to know why wiring to value property is sometimes needed and sometimes not.

  • Slow execution, flickering graphics, and too many threads, oh my!

    i wrote a little game called Aim, Fire! just to screw around.
    its immense complexity involves shooting little targets that fly across the screen.
    you can see it at http://www.brianmaissy.com/applets/aimfire
    i made a class representing a target that paints itself and is its own thread.
    its kinda nifty in a OOP sort of way: all i have to do is instantiate a target; and it takes care of the rest, notifying the driver program of anything important (like it getting shot)
    the problem, however, is the speed changes significantly depending on how many targets are active, and the graphics are very flickery.
    i think the problem may be that having multiple threads is slow.
    i also tried buffering my graphics but it didnt work very well.
    however that may just be because i did it wrong.
    in fact i probably did a lot of things wrong - please notify me of anything you see that i did badly
    so tell me what you think about the design of the program, and any suggestions you have to restructure it. would i do better just to stick everything in one thread, or even all in one class?
    thanks very much!
    here is the code: (also found at http://www.brianmaissy.com/applets/aimfire/aimFire/AimFire.java and http://www.brianmaissy.com/applets/aimfire/aimFire/Target.java)
    package aimFire;
    import java.applet.Applet;
    import java.awt.Color;
    import java.awt.Event;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.Point;
    import java.util.ArrayList;
    import java.util.Random;
    public class AimFire extends Applet{
         public static final int SPEED_CONSTANT = 500;
         public static final int MIN_X = 0;
         public static final int MIN_Y = 21;
         public static final int MAX_X = 399;
         public static final int MAX_Y = 399;
         Image ammoImage;
         private Random rand;
         private static final int CLIP = 10;
         private static final int TOTAL_TARGETS = 20;
         private int toBeAdded;
         private ArrayList<Target> targets;
         private int targetsKilled;
         private int ammo;
         private int score;
         private boolean gameActive;
         public void init(){
              setSize(400, 400);
              setBackground(Color.black);
            setCursor(getToolkit().createCustomCursor(getImage(this.getClass().getResource("crosshair.gif")), new Point(16, 16), "crosshair"));
            ammoImage = getImage(this.getClass().getResource("ammo.gif"));
            rand = new Random();
            ammo = CLIP;
            score = 0;
            gameActive = true;
            targetsKilled = 0;
            toBeAdded = TOTAL_TARGETS;
            targets = new ArrayList<Target>();
            sendRandom();
            sendRandom();
         public boolean mouseDown(Event e, int x, int y){
              if(gameActive && ammo > 0){
                   ammo--;
                   for(int count = 0; count < targets.size(); count++){
                        score += targets.get(count).hit(x, y);
                   repaint();
              return true;
         public boolean keyDown(Event e, int key){
              if((char)key == ' ' && gameActive){
                   ammo = CLIP;
                   repaint();
              return true;
         private void sendRandom(){
            toBeAdded--;
              Target t = new Target(this, getGraphics(), rand);
              targets.add(t);
            new Thread(t).start();
            repaint();
         public void notifyOfDeath(Target t){
              targetsKilled++;
              targets.remove(t);
              if(toBeAdded > 0){
                   sendRandom();
              if(targets.size()==0){
                   gameActive = false;
              repaint();
         public void paint(Graphics g){
              g.setColor(Color.gray);
            g.drawLine(0, 20, 399, 20);
              for(int count = 0; count < ammo; count++){
                   g.drawImage(ammoImage, count*10 + 3, 3, this);
              if(ammo == 0){
                   g.drawString("press space to reload", 3, 13);
            g.drawString("Targets: " + targetsKilled + "/" + TOTAL_TARGETS, 230, 13);
            g.drawString("Score: " + score, 340, 13);
              if(!gameActive){
                   g.setColor(Color.gray);
                   g.drawString("Game Over", 170, 200);
                   g.drawString("Score: " + score, 170, 230);
    package aimFire;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.util.Random;
    public class Target implements Runnable{
         private AimFire a;
         private Graphics g;
         private int radius;
         private int xLocation;
         private int yLocation;
         private int xDirection;
         private int yDirection;
         private int xSpeed;
         private int ySpeed;
         public Target(AimFire driver, Graphics graphics, Random rand){
              this(driver, graphics, 3*(rand.nextInt(9)+ 2), rand.nextInt(1 + AimFire.MAX_X - 60) + 30 + AimFire.MIN_X, rand.nextInt(1 + AimFire.MAX_Y - 60 - AimFire.MIN_Y) + 30 + AimFire.MIN_Y, rand.nextInt(3)-1, rand.nextInt(3)-1, rand.nextInt(5)+1, rand.nextInt(5)+1);
              if(xDirection == 0 && yDirection == 0){
                   if(rand.nextInt(2)==0){
                        if(rand.nextInt(2)==0){
                             xDirection = 1;
                        }else{
                             xDirection = -1;
                   }else{
                        if(rand.nextInt(2)==0){
                             yDirection = 1;
                        }else{
                             yDirection = -1;
         public Target(AimFire driver, Graphics graphics, int r, int x, int y, int xDir, int yDir, int xSp, int ySp){
              a = driver;
              g = graphics;
              radius = r;
              xLocation = x;
              yLocation = y;
              xDirection = xDir;
              yDirection = yDir;
              xSpeed = xSp;
              ySpeed = ySp;
         public void run() {
              if(g!=null){
                   paint();
                   int count = 1;
                   while(xLocation >= AimFire.MIN_X && xLocation <= AimFire.MAX_X && yLocation >= AimFire.MIN_Y && yLocation <= AimFire.MAX_Y){
                        unpaint();
                        if(count % (AimFire.SPEED_CONSTANT/xSpeed) == 0){
                             xLocation += xDirection;
                        if(count % (AimFire.SPEED_CONSTANT/ySpeed) == 0){
                             yLocation += yDirection;
                        paint();
                        count++;
                   unpaint();
                   a.notifyOfDeath(this);
         public int hit(int x, int y){
              if(Math.abs(x - xLocation) < radius/3 && Math.abs(y - yLocation) < radius/3){
                   xLocation = -99;
                   return 3;
              }else if(Math.abs(x - xLocation) < 2*radius/3 && Math.abs(y - yLocation) < 2*radius/3){
                   xLocation = -99;
                   return 2;
              }else if(Math.abs(x - xLocation) < radius && Math.abs(y - yLocation) < radius){
                   xLocation = -99;
                   return 1;
              }else{
                   return 0;
         private void paint(){
              g.setColor(Color.red);
              g.fillOval(xLocation-radius, yLocation-radius, 2*radius, 2*radius);
              g.setColor(Color.white);
              g.fillOval(xLocation-2*radius/3, yLocation-2*radius/3, 4*radius/3, 4*radius/3);
              g.setColor(Color.red);
              g.fillOval(xLocation-radius/3, yLocation-radius/3, 2*radius/3, 2*radius/3);
         private void unpaint(){
              g.setColor(Color.black);
              g.fillOval(xLocation-radius, yLocation-radius, 2*radius, 2*radius);
    }

    i wrote a little game called Aim, Fire! just to screw around.
    its immense complexity involves shooting little targets that fly across the screen.
    you can see it at http://www.brianmaissy.com/applets/aimfire
    i made a class representing a target that paints itself and is its own thread.
    its kinda nifty in a OOP sort of way: all i have to do is instantiate a target; and it takes care of the rest, notifying the driver program of anything important (like it getting shot)
    the problem, however, is the speed changes significantly depending on how many targets are active, and the graphics are very flickery.
    i think the problem may be that having multiple threads is slow.
    i also tried buffering my graphics but it didnt work very well.
    however that may just be because i did it wrong.
    in fact i probably did a lot of things wrong - please notify me of anything you see that i did badly
    so tell me what you think about the design of the program, and any suggestions you have to restructure it. would i do better just to stick everything in one thread, or even all in one class?
    thanks very much!
    here is the code: (also found at http://www.brianmaissy.com/applets/aimfire/aimFire/AimFire.java and http://www.brianmaissy.com/applets/aimfire/aimFire/Target.java)
    package aimFire;
    import java.applet.Applet;
    import java.awt.Color;
    import java.awt.Event;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.Point;
    import java.util.ArrayList;
    import java.util.Random;
    public class AimFire extends Applet{
         public static final int SPEED_CONSTANT = 500;
         public static final int MIN_X = 0;
         public static final int MIN_Y = 21;
         public static final int MAX_X = 399;
         public static final int MAX_Y = 399;
         Image ammoImage;
         private Random rand;
         private static final int CLIP = 10;
         private static final int TOTAL_TARGETS = 20;
         private int toBeAdded;
         private ArrayList<Target> targets;
         private int targetsKilled;
         private int ammo;
         private int score;
         private boolean gameActive;
         public void init(){
              setSize(400, 400);
              setBackground(Color.black);
            setCursor(getToolkit().createCustomCursor(getImage(this.getClass().getResource("crosshair.gif")), new Point(16, 16), "crosshair"));
            ammoImage = getImage(this.getClass().getResource("ammo.gif"));
            rand = new Random();
            ammo = CLIP;
            score = 0;
            gameActive = true;
            targetsKilled = 0;
            toBeAdded = TOTAL_TARGETS;
            targets = new ArrayList<Target>();
            sendRandom();
            sendRandom();
         public boolean mouseDown(Event e, int x, int y){
              if(gameActive && ammo > 0){
                   ammo--;
                   for(int count = 0; count < targets.size(); count++){
                        score += targets.get(count).hit(x, y);
                   repaint();
              return true;
         public boolean keyDown(Event e, int key){
              if((char)key == ' ' && gameActive){
                   ammo = CLIP;
                   repaint();
              return true;
         private void sendRandom(){
            toBeAdded--;
              Target t = new Target(this, getGraphics(), rand);
              targets.add(t);
            new Thread(t).start();
            repaint();
         public void notifyOfDeath(Target t){
              targetsKilled++;
              targets.remove(t);
              if(toBeAdded > 0){
                   sendRandom();
              if(targets.size()==0){
                   gameActive = false;
              repaint();
         public void paint(Graphics g){
              g.setColor(Color.gray);
            g.drawLine(0, 20, 399, 20);
              for(int count = 0; count < ammo; count++){
                   g.drawImage(ammoImage, count*10 + 3, 3, this);
              if(ammo == 0){
                   g.drawString("press space to reload", 3, 13);
            g.drawString("Targets: " + targetsKilled + "/" + TOTAL_TARGETS, 230, 13);
            g.drawString("Score: " + score, 340, 13);
              if(!gameActive){
                   g.setColor(Color.gray);
                   g.drawString("Game Over", 170, 200);
                   g.drawString("Score: " + score, 170, 230);
    package aimFire;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.util.Random;
    public class Target implements Runnable{
         private AimFire a;
         private Graphics g;
         private int radius;
         private int xLocation;
         private int yLocation;
         private int xDirection;
         private int yDirection;
         private int xSpeed;
         private int ySpeed;
         public Target(AimFire driver, Graphics graphics, Random rand){
              this(driver, graphics, 3*(rand.nextInt(9)+ 2), rand.nextInt(1 + AimFire.MAX_X - 60) + 30 + AimFire.MIN_X, rand.nextInt(1 + AimFire.MAX_Y - 60 - AimFire.MIN_Y) + 30 + AimFire.MIN_Y, rand.nextInt(3)-1, rand.nextInt(3)-1, rand.nextInt(5)+1, rand.nextInt(5)+1);
              if(xDirection == 0 && yDirection == 0){
                   if(rand.nextInt(2)==0){
                        if(rand.nextInt(2)==0){
                             xDirection = 1;
                        }else{
                             xDirection = -1;
                   }else{
                        if(rand.nextInt(2)==0){
                             yDirection = 1;
                        }else{
                             yDirection = -1;
         public Target(AimFire driver, Graphics graphics, int r, int x, int y, int xDir, int yDir, int xSp, int ySp){
              a = driver;
              g = graphics;
              radius = r;
              xLocation = x;
              yLocation = y;
              xDirection = xDir;
              yDirection = yDir;
              xSpeed = xSp;
              ySpeed = ySp;
         public void run() {
              if(g!=null){
                   paint();
                   int count = 1;
                   while(xLocation >= AimFire.MIN_X && xLocation <= AimFire.MAX_X && yLocation >= AimFire.MIN_Y && yLocation <= AimFire.MAX_Y){
                        unpaint();
                        if(count % (AimFire.SPEED_CONSTANT/xSpeed) == 0){
                             xLocation += xDirection;
                        if(count % (AimFire.SPEED_CONSTANT/ySpeed) == 0){
                             yLocation += yDirection;
                        paint();
                        count++;
                   unpaint();
                   a.notifyOfDeath(this);
         public int hit(int x, int y){
              if(Math.abs(x - xLocation) < radius/3 && Math.abs(y - yLocation) < radius/3){
                   xLocation = -99;
                   return 3;
              }else if(Math.abs(x - xLocation) < 2*radius/3 && Math.abs(y - yLocation) < 2*radius/3){
                   xLocation = -99;
                   return 2;
              }else if(Math.abs(x - xLocation) < radius && Math.abs(y - yLocation) < radius){
                   xLocation = -99;
                   return 1;
              }else{
                   return 0;
         private void paint(){
              g.setColor(Color.red);
              g.fillOval(xLocation-radius, yLocation-radius, 2*radius, 2*radius);
              g.setColor(Color.white);
              g.fillOval(xLocation-2*radius/3, yLocation-2*radius/3, 4*radius/3, 4*radius/3);
              g.setColor(Color.red);
              g.fillOval(xLocation-radius/3, yLocation-radius/3, 2*radius/3, 2*radius/3);
         private void unpaint(){
              g.setColor(Color.black);
              g.fillOval(xLocation-radius, yLocation-radius, 2*radius, 2*radius);
    }

  • Obiee essbase time series calc todate returns 0

    1) when I enter todate in answers column formula I alwaus get systen error on time level?  Works fine in rpd.
    2) My period dimension is Dec through Jan.  What is the current month when I use todate()
    3) I'm trying to do a year to date calc based on a substition variable any suggestions?

    Does a month have always the same number of week and begin with the first day of a week ?
    If it's not the case, your dimension is not good when you make a report on the week grain for a year ago for instance.
    Here a check list:
    http://gerardnico.com/wiki/dat/obiee/ago_todate_configuration#timecalender_dimension_design_verification
    Success
    Nico

  • OBIEE  is slow when move from one page to another in OBIEE Dashboard

    Hi Experts,
    When I move from one page(Tab) to another page in OBIEE dashbord. It is taking too much time . Please suggest how can we overcome this.
    Thanks,

    Server is in UK.
    It is running fine in Production for same time zone,But stuck in stage.
    Thanks,

  • OBIEE & Essbase - Reduce Data Cache in OBI Server

    Hi,
    We have a essbase ASO cube and using it as a source we have created a dashboard.
    But when we change the data in the cube (for example, what-if or online data analysis) the dashboard dose not change since the BI server cache the data.
    How do we reduce this cache period for a particular cube or a dashboard.
    Thanks
    Nilaksha.

    Have you tried reducing the time in the Cache Persistence time?
    Hope it helps
    Thanks
    Prash

Maybe you are looking for

  • My photos will not stay in the order I uploaded them to my my iPod and they changed their names

    I'm really frustrated. I'm trying to put photos in albums on my iPod and iPad.  I arranged them on my computer into the order I wanted and uploaded the files I wanted via iTunes as per directions. They are not in the order that they were in the file

  • Need help on Select statement/Formula

    Post Author: Krazy Kasper CA Forum: Data Connectivity and SQL My crystal report (Crystal Reports X) pulls about five thousand records/transactions. When any 2 transactions have every field the same except STATUS, I want to select from those 2 that tr

  • I18n.jar missing in J2SDK 1.4.0 beta3 for Windows

    I have installed J2SDK 1.4.0 beta3 on a WinNT system. The jre\lib folder does not contain the file i18n.jar Also, I have tried to install J2RE 1.4.0 beta3 on a WinNT system. The i18n.jar is missing there too. The Java 2 SDK File Structure shows the f

  • Copy English Translation into German - Programatically

    All, This is my requirement. We have over 780 custom reports in SAP ECC 6 box. All reports are generated for language English. ( Selection Text and Text elements are only in English ). Now we wanted to use same reports for German. But If we login int

  • Lync Client Can't Download Address List and other problems

    We're currently in the process of testing for a production Lync Server 2010 deployment and we're run into some problems. I've been digging around on the Internet and the Technet forums but can't find a solution to this problem. Whenever someone logs