Oval creation w/ star inside?

So I'm trying to create a framed oval and put a 5 pointed star inside as part of a class project. The design is more or less up to me- I don't have to put a star in. However, I would like to know how to do this. I am familiar with the creation of lines and ovals, but I am not familiar with the equations required to make the lines grow with the oval as the oval is resized within the program. I can't seem to get the endpoints of the lines to rest perfectly on the frame of the oval; they are either breaching it or not quite long enough. I know how to make the lines grow, just not the correct equation to make them grow properly. If anyone has any experience with this sort of thing, I'd be be quite thankful for their information.
Jedifarmer

There were some errors:  public void drawStar(Graphics g){
    int centerX=x+width/2;
    int centerY=y+height/2;
    int[] pointsX=new int[5];
    int[] pointsY=new int[5];
    for(int i=0;i<5;i++){ 
      pointsX=(int)(width/2*Math.cos(i*2*Math.PI/5));
pointsY[i]=(int)(height/2*Math.sin(i*2*Math.PI/5));
for(int i=0;i<5;i++){
g.drawLine(centerX+pointsX[i],centerY+pointsY[i],centerX+pointsX[(i+2)%5],centerY+pointsY[(i+2)%5]);}

Similar Messages

  • How to know if iam in tcode  creation or modif  inside abap  prog ?

    hello ,
    i  want  to  know if there  is any things  that can  help  me to know  if  iam  in tcode  of creation (ME21N) o  modification (ME22N/ME23N) for  PO,  without using  sy-tcode inside a program of smartforms edition.
    thanks ,
    karim

    >
    karim sefiani sefiani wrote:
    > hello ,
    >  
    > i  want  to  know if there  is any things  that can  help  me to know  if  iam  in tcode  of creation (ME21N) o  modification (ME22N/ME23N) for  PO,  without using  sy-tcode inside a program of smartforms edition.
    >
    >  thanks ,
    > karim
    Please check the value of the variable T180-TRTYP
    T180-TRTYP = H - Create - ME21N
    T180-TRTYP = V - Change - ME22N
    generally 'A' in case of display transactions, however the table T180 shows the value 'V' in case of ME23N also, kindly check

  • Creation of class inside Method

    Hi Forums,
            I am new to WebDynpro-Abap and i am trying to practice WebDynpro-Abap with the help of  standard Tutorial avl in the SDN.
            In the Tutorial 4, i am getting the following error,
    The type <b>CL_WDABAP_FLIGHT_MODEL=>get_bookings is unknown or not found</b>
            but in that tutorial,they specify the  encounter of  the above error like
    <u>Simply create a ZCL_WDABAP_FLIGHT_MODEL class in your get_bookings method.</u>
           But  i don't know,where  to  Create the class  inside the get_bookings method
    can any body  tell me the steps to create  ZCL_WDABAP_FLIGHT_MODEL class in the get_bookings method and the remaining steps to execute the particular application.
    Thanks in Advance,
    Ashok

    Hi Ashok,
    Follow the steps for creation of Class and the method,
    STEPS TO CREATE CLASS:
    1) CREATE ZIT_FLIGHTTAB(AN INTERNAL TABLE) IN SE11 UNDER DATA TYPE->TABLE TYPE.
    2) GIVE LINE TYPE AS SFLIGHT. SAVE,CHECK AND ACTIVATE THE INTERNAL TABLE.
    3) CREATE GLOBAL CLASS ZNET_NET310_FLIGHTMODEL_## USING TRANSACTION CODE SE24.
    4) IN THE ATTRIBUTES TAB, ENTER AS FOLLOWS,
        ATTRIBUTE          LEVEL          VISIBILITY     TYPING          ASSOCIATED TYPE
        TY_FLIGHTS        STATIC ATTRIBUTE       PUBLIC     TYPE             SFLIGHT
        ZIT_OUTTAB        STATIC ATTRIBUTE       PUBLIC     TYPE             TY_FLIGHTS
    5) IN THE METHODS TAB, ENTER AS FOLLOWS,
          METHOD          LEVEL          VISIBILITY     DESCRIPTION
       READ_FLIGHTS          STATIC METHOD        PUBLIC     READ FLIGHT DATA
    6) CLICK ON PARAMETERS, ENTER AS FOLLOWS,
          PARAMETER          TYPE          TYPING METHOD     ASSOCIATED TYPE          
          I_CARRID           IMPORTING             TYPE          SFLIGHT-CARRID
          I_CONNID           IMPORTING             TYPE         SFLIGHT-CONNID
          E_FLIGHTS           EXPORTING            TYPE         ZIT_FLIGHTTAB
    7) DOUBLE CLICK ON METHOD:READ_FLIGHTS AND ENTER FOLLOWING SORCE CODE IN BETWEEN METHOD AND ENDMETHOD.
         SELECT * FROM SFLIGHT INTO TABLE ZIT_OUTTAB WHERE CARRID = I_CARRID AND CONNID = I_CONNID.
          E_FLIGHTS[] = ZIT_OUTTAB[].
    8) SAVE CHECK AND ACTIVATE CLASS.
    NOTE :
    PLEASE FOLLOW SAME STEPS FOR OTHER METHODS THAT COMES IN FOLLOWING EXCERCISE IN SAME CLASS i.e ZCL_NET310_FLIGHTMODEL_##.
    In next few tutorials you will need to create more methods. Follow steps to add new methods as and when required.
    Regards,
    Achyut

  • Creation of star schema from snowflake schem in BMM layer

    hi,
    This is my situation.I have "Fact-table" which has Dim 1 .now Dim 1 is joined to Dim2,Dim3
    Fact
    |
    Dim 1
    |
    | |
    Dim 2 Dim 3
    Now in Bmm Layer how can i make this snowfalke schema to star schema.I heard about making changes in the Logical Table source.And what will be the look of the presentation layer.
    Any help is appricaited Guys.

    In physical layer, you have a join between Dim 1 and Dim 2, Dim1 and DIm3, Fact and Dim1. In BMM for Dim1, in the sources, add Dim2 and Dim3. You may add both these dimensions in one single LTS if the data is not duplicate in the tables. In case the data is duplicated add them as seperate LTS in the sources for Dim1. Refer this post for reference -- Logical Table source source query
    In BMM you need a join between Dim1 and Fact. Basically your Dim1 is sourced from three different tables which are your dimensions. This would transform your snowflake into star. In your presentation layer you will have all the columns from your dimensions (except for the duplicates, lets say you have column A in both dim1 and dim2, you should map this column in column mapping tab so as to enable BI server to pick the most economical source) and facts.
    Hope this clears your question.

  • Creation of role inside a role

    hi,
    is it possible to create a role under another role in cProjects.  I mean, with parent child relations ship.. so, i can see the subrole(s) staffing getting roled up on to the parent role and check the status of supply agianst the demand on the parent role
    (which i got from the item through Transfer Demand).
    Pls suggest.

    Hi sujata,
    No, it is not possible to build up a role hierarchy.
    Though internally the resource assignments of a role are builed up using a parent-child relations, but it has other meaning as you expected.
    Either you need to develop your own program bot fulfill the requirements. Wr you may use the task-role assignement to build you scenario, that means task is used as the 'parent-role'.  In this case you get the assigned roles information be rolled up.
    Kind regards,
    Zhenbo

  • How do I make text fill an oval and then place behind a background layer with CSS

    Hi everyone,
    I created a framed oval picture as a background with drop shadow for my portfolio site.
    See:  www.adjacentdimensionsmedia.com
    Now I want to put text on a clear "glass window/png" that fills an oval that will go inside the frame and I would like it to slide up behind the black background frame, but on top of the image.
    I would like to move the scroll bar so that the text which will be about my services can slide up and fit the ovals you scroll down.
    I tried:
    div class= "circle"
    </div>
    .circle {
    shape-inside:
    polygon (0px 150px)
    and it didn't work.
    I thought I would use Z-axis to get it behind background but I am not sure if that will work.
    any thoughts?

    I had never heard of shape-inside before, so I did some poking around.
    Looks like shape-inside is an experimental feature with little to no browsers supporting it.
    On top of that, as far as I can tell from the documentation about it, a single set of coordinates with the polygon value won't do anything either way. You need at least 3 coordinates with polygon (making a triangle as the minimum). And that is only for the reflow of content, it has nothing to do with the actual shape of the element it's being used on.
    If done correctly, in combination with the border-radius attribute, one could create a circle with a container element, then theoretically use a many sided polygon with shape-inside to force the content of the circular container to take on a relatively circular flow (think octagon in a circle).
    I wasn't able to make any shape-inside settings work in any current browser though.
    EDIT: Actually, I was able to get it to work in Chrome, with the -webkit- prefix and a newly downloaded version of Opera using the standard nomenclature. Definitely not ready for prime time. For shape-outside testing anyway. Shape-inside I still can't get to function in either.

  • Cut out a star!

    Hi!
    I need some help from Freehand profesionals!
    My problem is:
    I create one restangle, colored it and now I need to cut out
    a star inside of this restangle. Is it possible and how can I do
    it?!
    Thank you in advance!
    student
    Anete

    > Draw a star with a fill of 'none' on top of the coloured
    rectangle, select both objects, got to Xtras menu > Path
    Operations > Punch.
    Or simply select both and use Modify > Join.
    Jukka

  • Is there a better way to do this projection/aggregate query?

    Hi,
    Summary:
    Can anyone offer advice on how best to use JDO to perform
    projection/aggregate queries? Is there a better way of doing what is
    described below?
    Details:
    The web application I'm developing includes a GUI for ad-hoc reports on
    JDO's. Unlike 3rd party tools that go straight to the database we can
    implement business rules that restrict access to objects (by adding extra
    predicates) and provide extra calculated fields (by adding extra get methods
    to our JDO's - no expression language yet). We're pleased with the results
    so far.
    Now I want to make it produce reports with aggregates and projections
    without instantiating JDO instances. Here is an example of the sort of thing
    I want it to be capable of doing:
    Each asset has one associated t.description and zero or one associated
    d.description.
    For every distinct combination of t.description and d.description (skip
    those for which there are no assets)
    calculate some aggregates over all the assets with these values.
    and here it is in SQL:
    select t.description type, d.description description, count(*) count,
    sum(a.purch_price) sumPurchPrice
    from assets a
    left outer join asset_descriptions d
    on a.adesc_no = d.adesc_no,
    asset_types t
    where a.atype_no = t.atype_no
    group by t.description, d.description
    order by t.description, d.description
    it takes <100ms to produce 5300 rows from 83000 assets.
    The nearest I have managed with JDO is (pseodo code):
    perform projection query to get t.description, d.description for every asset
    loop on results
    if this is first time we've had this combination of t.description,
    d.description
    perform aggregate query to get aggregates for this combination
    The java code is below. It takes about 16000ms (with debug/trace logging
    off, c.f. 100ms for SQL).
    If the inner query is commented out it takes about 1600ms (so the inner
    query is responsible for 9/10ths of the elapsed time).
    Timings exclude startup overheads like PersistenceManagerFactory creation
    and checking the meta data against the database (by looping 5 times and
    averaging only the last 4) but include PersistenceManager creation (which
    happens inside the loop).
    It would be too big a job for us to directly generate SQL from our generic
    ad-hoc report GUI, so that is not really an option.
    KodoQuery q1 = (KodoQuery) pm.newQuery(Asset.class);
    q1.setResult(
    "assetType.description, assetDescription.description");
    q1.setOrdering(
    "assetType.description ascending,
    assetDescription.description ascending");
    KodoQuery q2 = (KodoQuery) pm.newQuery(Asset.class);
    q2.setResult("count(purchPrice), sum(purchPrice)");
    q2.declareParameters(
    "String myAssetType, String myAssetDescription");
    q2.setFilter(
    "assetType.description == myAssetType &&
    assetDescription.description == myAssetDescription");
    q2.compile();
    Collection results = (Collection) q1.execute();
    Set distinct = new HashSet();
    for (Iterator i = results.iterator(); i.hasNext();) {
    Object[] cols = (Object[]) i.next();
    String assetType = (String) cols[0];
    String assetDescription = (String) cols[1];
    String type_description =
    assetDescription != null
    ? assetType + "~" + assetDescription
    : assetType;
    if (distinct.add(type_description)) {
    Object[] cols2 =
    (Object[]) q2.execute(assetType,
    assetDescription);
    // System.out.println(
    // "type "
    // + assetType
    // + ", description "
    // + assetDescription
    // + ", count "
    // + cols2[0]
    // + ", sum "
    // + cols2[1]);
    q2.closeAll();
    q1.closeAll();

    Neil,
    It sounds like the problem that you're running into is that Kodo doesn't
    yet support the JDO2 grouping constructs, so you're doing your own
    grouping in the Java code. Is that accurate?
    We do plan on adding direct grouping support to our aggregate/projection
    capabilities in the near future, but as you've noticed, those
    capabilities are not there yet.
    -Patrick
    Neil Bacon wrote:
    Hi,
    Summary:
    Can anyone offer advice on how best to use JDO to perform
    projection/aggregate queries? Is there a better way of doing what is
    described below?
    Details:
    The web application I'm developing includes a GUI for ad-hoc reports on
    JDO's. Unlike 3rd party tools that go straight to the database we can
    implement business rules that restrict access to objects (by adding extra
    predicates) and provide extra calculated fields (by adding extra get methods
    to our JDO's - no expression language yet). We're pleased with the results
    so far.
    Now I want to make it produce reports with aggregates and projections
    without instantiating JDO instances. Here is an example of the sort of thing
    I want it to be capable of doing:
    Each asset has one associated t.description and zero or one associated
    d.description.
    For every distinct combination of t.description and d.description (skip
    those for which there are no assets)
    calculate some aggregates over all the assets with these values.
    and here it is in SQL:
    select t.description type, d.description description, count(*) count,
    sum(a.purch_price) sumPurchPrice
    from assets a
    left outer join asset_descriptions d
    on a.adesc_no = d.adesc_no,
    asset_types t
    where a.atype_no = t.atype_no
    group by t.description, d.description
    order by t.description, d.description
    it takes <100ms to produce 5300 rows from 83000 assets.
    The nearest I have managed with JDO is (pseodo code):
    perform projection query to get t.description, d.description for every asset
    loop on results
    if this is first time we've had this combination of t.description,
    d.description
    perform aggregate query to get aggregates for this combination
    The java code is below. It takes about 16000ms (with debug/trace logging
    off, c.f. 100ms for SQL).
    If the inner query is commented out it takes about 1600ms (so the inner
    query is responsible for 9/10ths of the elapsed time).
    Timings exclude startup overheads like PersistenceManagerFactory creation
    and checking the meta data against the database (by looping 5 times and
    averaging only the last 4) but include PersistenceManager creation (which
    happens inside the loop).
    It would be too big a job for us to directly generate SQL from our generic
    ad-hoc report GUI, so that is not really an option.
    KodoQuery q1 = (KodoQuery) pm.newQuery(Asset.class);
    q1.setResult(
    "assetType.description, assetDescription.description");
    q1.setOrdering(
    "assetType.description ascending,
    assetDescription.description ascending");
    KodoQuery q2 = (KodoQuery) pm.newQuery(Asset.class);
    q2.setResult("count(purchPrice), sum(purchPrice)");
    q2.declareParameters(
    "String myAssetType, String myAssetDescription");
    q2.setFilter(
    "assetType.description == myAssetType &&
    assetDescription.description == myAssetDescription");
    q2.compile();
    Collection results = (Collection) q1.execute();
    Set distinct = new HashSet();
    for (Iterator i = results.iterator(); i.hasNext();) {
    Object[] cols = (Object[]) i.next();
    String assetType = (String) cols[0];
    String assetDescription = (String) cols[1];
    String type_description =
    assetDescription != null
    ? assetType + "~" + assetDescription
    : assetType;
    if (distinct.add(type_description)) {
    Object[] cols2 =
    (Object[]) q2.execute(assetType,
    assetDescription);
    // System.out.println(
    // "type "
    // + assetType
    // + ", description "
    // + assetDescription
    // + ", count "
    // + cols2[0]
    // + ", sum "
    // + cols2[1]);
    q2.closeAll();
    q1.closeAll();

  • Enable for commenting in Reader -- Inconsistent behavior?

    Many similar threads on the forum, but my problem seems different.  I've built a portfolio in Acrobat Pro 9, containing multiple folders -- each with multiple files.  I want to enable all the files (mostly pdf's) for commenting in Reader  (urging clients to upgrade to Reader 9).  The portfolio will have password security allowing printing, commenting, forms, and existing signatures.
    With security off in Acrobat Pro, I opened each folder, selected all files as a group, and enabled for comments under the comment menu.  (Although that menu item is followed by an ellipsis ...., no dialog box followed.)  Still in Acrobat, I confirmed that the Comment and Markup Tools were available for each file.  I then reset to Password Security under Portfolio Properties, with permissions as noted above, including commenting.  Immediately after this, I saved the portfolio, and the title bar changed to SECURED as expected.  Still in Acrobat Pro, I checked all the files in all the folders, and the markup tools remained available  (except with jpg files, as I think is expected).
    When I open the document in Reader 9, only the first file in each folder has the Comment and Markup Tools menu option available.  I repeated the process described in the previous paragraph, this time enabling each file individually then setting the security for the portfolio.  This managed to get two more files with Comment and Markup tools available, but the remaining 20 or so files still had none.  When I open Portfolio Properties in Reader 9, under the Security tab, the upper box shows Password Security and the Show Details button pops up confirmation of the permissions I had set, including that Commenting is allowed.  However, the lower box, Document Restrictions Summary, gives similar information, except that commenting is not allowed.  This discrepancy makes no sense to me.
    When I open the Security | Show Security Properties ... for an individual file, Commenting, Assembly, Signing and Template Creation are starred as restricted.  For the few files that do allow commenting, the starred fields are the same, except that Commenting is unstarred (allowed) and Form Fields is starred instead.  All the files were set up the same, and most are pdf's created from Word or Excel.
    Any ideas what is going on and how to fix it?
    Thanks for the help.

    OK, I think that is best suited to larger organisations who create lots of documents that need to be commented on around the organisation.  Our application is a CAD system that exports a surface based CAD model as a U3D file embedded in a PDF.  So the user in the CAD Office creates a CAD model and exports a PDF as a lightweight file format to pass to someone in another department, or maybe their customer.  They want to be able to measure the odd length and hole diameter easily in Reader.  I've been asked if the CAD system can create the PDF file already enabled for commenting.

  • IMovie still too big

    I thought I had solved my problem by splitting the movie in part 1 and part 2.
    I took the first part (after I cleared the rest of the movie) and tried to SHARE it with iDVD,
    But I still get the message that it is too long for a DVD.
    This first part is now only 1 hr 10 minutes.
    Can anyone give me more help, please.

    Project info choices are: Best Perf, High quality, Prof. qual. I picked Best Performance,
    Part 1 of my iMovie is 83 minutes and 4.59GB
    Using iMovie HD 6.0.3
    When I use SHARE I am still informed that project is too big when I attempt to burn it.
    When I close iMovie and go thru iDVD and try to bring it in then my iMovie is greyed out
    My iMovie has an icon with the black star inside - that is what I'm to use, right?
    I must be doing something wrong! Any more ideas?
    Thanks for all your help so far.
    Got to get this movie off my HD - it's taking up too much room! Only have 25GB open, could that be related to my problem?

  • Very Slow Query with CTE inner join

    I have 2 tables (heavily simplified here to show relevant columns):
    CREATE TABLE tblCharge
    (ChargeID int NOT NULL,
    ParentChargeID int NULL,
    ChargeName varchar(200) NULL)
    CREATE TABLE tblChargeShare
    (ChargeShareID int NOT NULL,
    ChargeID int NOT NULL,
    TotalAmount money NOT NULL,
    TaxAmount money NULL,
    DiscountAmount money NULL,
    CustomerID int NOT NULL,
    ChargeShareStatusID int NOT NULL)
    I have a very basic View to Join them:
    CREATE VIEW vwBASEChargeShareRelation as
    Select c.ChargeID, ParentChargeID, s.CustomerID, s.TotalAmount, isnull(s.TaxAmount, 0) as TaxAmount, isnull(s.DiscountAmount, 0) as DiscountAmount
    from tblCharge c inner join tblChargeShare s
    on c.ChargeID = s.ChargeID Where s.ChargeShareStatusID < 3
    GO
    I then have a view containing a CTE to get the children of the Parent Charge:
    ALTER VIEW [vwChargeShareSubCharges] AS
    WITH RCTE AS
    SELECT ParentChargeId, ChargeID, 1 AS Lvl, ISNULL(TotalAmount, 0) as TotalAmount, ISNULL(TaxAmount, 0) as TaxAmount,
    ISNULL(DiscountAmount, 0) as DiscountAmount, CustomerID, ChargeID as MasterChargeID
    FROM vwBASEChargeShareRelation Where ParentChargeID is NULL
    UNION ALL
    SELECT rh.ParentChargeID, rh.ChargeID, Lvl+1 AS Lvl, ISNULL(rh.TotalAmount, 0), ISNULL(rh.TaxAmount, 0), ISNULL(rh.DiscountAmount, 0) , rh.CustomerID
    , rc.MasterChargeID
    FROM vwBASEChargeShareRelation rh
    INNER JOIN RCTE rc ON rh.PArentChargeID = rc.ChargeID and rh.CustomerID = rc.CustomerID
    Select MasterChargeID as ChargeID, CustomerID, Sum(TotalAmount) as TotalCharged, Sum(TaxAmount) as TotalTax, Sum(DiscountAmount) as TotalDiscount
    from RCTE
    Group by MasterChargeID, CustomerID
    GO
    So far so good, I can query this view and get the total cost for a line item including all children.
    The problem occurs when I join this table. The query:
    Select t.* from vwChargeShareSubCharges t
    inner join
    tblChargeShare s
    on t.CustomerID = s.CustomerID
    and t.MasterChargeID = s.ChargeID
    Where s.ChargeID = 1291094
    Takes around 30 ms to return a result (tblCharge and Charge Share have around 3.5 million records).
    But the query:
    Select t.* from vwChargeShareSubCharges t
    inner join
    tblChargeShare s
    on t.CustomerID = s.CustomerID
    and t.MasterChargeID = s.ChargeID
    Where InvoiceID = 1045854
    Takes around 2 minutes to return a result - even though the only charge with that InvoiceID is the same charge as the one used in the previous query.
    The same thing occurs if I do the join in the same query that the CTE is defined in.
    I ran the execution plan for each query. The first (fast) query looks like this:
    The second(slow) query looks like this:
    I am at a loss, and my skills at decoding execution plans to resolve this are lacking.
    I have separate indexes on tblCharge.ChargeID, tblCharge.ParentChargeID, tblChargeShare.ChargeID, tblChargeShare.InvoiceID, tblChargeShare.ChargeShareStatusID
    Any ideas? Tested on SQL 2008R2 and SQL 2012

    >> The database is linked [sic] to an established app and the column and table names can't be changed. <<
    Link? That is a term from pointer chains and network databases, not SQL. I will guess that means the app came back in the old pre-RDBMS days and you are screwed. 
    >> I am not too worried about the money field [sic], this is used for money and money based calculations so the precision and rounding are acceptable at this level. <<
    Field is a COBOL concept; columns are totally different. MONEY is how Sybase mimics the PICTURE clause that puts currency signs, commas, period, etc in a COBOL money field. 
    Using more than one operation (multiplication or division) on money columns will produce severe rounding errors. A simple way to visualize money arithmetic is to place a ROUND() function calls after 
    every operation. For example,
    Amount = (Portion / total_amt) * gross_amt
    can be rewritten using money arithmetic as:
    Amount = ROUND(ROUND(Portion/total_amt, 4) * 
    gross_amt, 4)
    Rounding to four decimal places might not seem an 
    issue, until the numbers you are using are greater 
    than 10,000. 
    BEGIN
    DECLARE @gross_amt MONEY,
     @total_amt MONEY,
     @my_part MONEY,
     @money_result MONEY,
     @float_result FLOAT,
     @all_floats FLOAT;
     SET @gross_amt = 55294.72;
     SET @total_amt = 7328.75;
     SET @my_part = 1793.33;
     SET @money_result = (@my_part / @total_amt) * 
    @gross_amt;
     SET @float_result = (@my_part / @total_amt) * 
    @gross_amt;
     SET @Retult3 = (CAST(@my_part AS FLOAT)
     / CAST( @total_amt AS FLOAT))
     * CAST(FLOAT, @gross_amt AS FLOAT);
     SELECT @money_result, @float_result, @all_floats;
    END;
    @money_result = 13525.09 -- incorrect
    @float_result = 13525.0885 -- incorrect
    @all_floats = 13530.5038673171 -- correct, with a -
    5.42 error 
    >> The keys are ChargeID(int, identity) and ChargeShareID(int, identity). <<
    Sorry, but IDENTITY is not relational and cannot be a key by definition. But it sure works just like a record number in your old COBOL file system. 
    >> .. these need to be int so that they are assigned by the database and unique. <<
    No, the data type of a key is not determined by physical storage, but by logical design. IDENTITY is the number of a parking space in a garage; a VIN is how you identify the automobile. 
    >> What would you recommend I use as keys? <<
    I do not know. I have no specs and without that, I cannot pull a Kabbalah number from the hardware. Your magic numbers can identify Squids, Automobile or Lady Gaga! I would ask the accounting department how they identify a charge. 
    >> Charge_Share_Status_ID links [sic] to another table which contains the name, formatting [sic] and other information [sic] or a charge share's status, so it is both an Id and a status. <<
    More pointer chains! Formatting? Unh? In RDBMS, we use a tiered architecture. That means display formatting is in a presentation layer. A properly created table has cohesion – it does one and only one data element. A status is a state of being that applies
    to an entity over a period time (think employment, marriage, etc. status if that is too abstract). 
    An identifier is based on the Law of Identity from formal logic “To be is to be something in particular” or “A is A” informally. There is no entity here! The Charge_Share_Status table should have the encoded values for a status and perhaps a description if
    they are unclear. If the list of values is clear, short and static, then use a CHECK() constraint. 
    On a scale from 1 to 10, what color is your favorite letter of the alphabet? Yes, this is literally that silly and wrong. 
    >> I understand what a CTE is; is there a better way to sum all children for a parent hierarchy? <<
    There are many ways to represent a tree or hierarchy in SQL.  This is called an adjacency list model and it looks like this:
    CREATE TABLE OrgChart 
    (emp_name CHAR(10) NOT NULL PRIMARY KEY, 
     boss_emp_name CHAR(10) REFERENCES OrgChart(emp_name), 
     salary_amt DECIMAL(6,2) DEFAULT 100.00 NOT NULL,
     << horrible cycle constraints >>);
    OrgChart 
    emp_name  boss_emp_name  salary_amt 
    ==============================
    'Albert'    NULL    1000.00
    'Bert'    'Albert'   900.00
    'Chuck'   'Albert'   900.00
    'Donna'   'Chuck'    800.00
    'Eddie'   'Chuck'    700.00
    'Fred'    'Chuck'    600.00
    This approach will wind up with really ugly code -- CTEs hiding recursive procedures, horrible cycle prevention code, etc.  The root of your problem is not knowing that rows are not records, that SQL uses sets and trying to fake pointer chains with some
    vague, magical non-relational "id".  
    This matches the way we did it in old file systems with pointer chains.  Non-RDBMS programmers are comfortable with it because it looks familiar -- it looks like records and not rows.  
    Another way of representing trees is to show them as nested sets. 
    Since SQL is a set oriented language, this is a better model than the usual adjacency list approach you see in most text books. Let us define a simple OrgChart table like this.
    CREATE TABLE OrgChart 
    (emp_name CHAR(10) NOT NULL PRIMARY KEY, 
     lft INTEGER NOT NULL UNIQUE CHECK (lft > 0), 
     rgt INTEGER NOT NULL UNIQUE CHECK (rgt > 1),
      CONSTRAINT order_okay CHECK (lft < rgt));
    OrgChart 
    emp_name         lft rgt 
    ======================
    'Albert'      1   12 
    'Bert'        2    3 
    'Chuck'       4   11 
    'Donna'       5    6 
    'Eddie'       7    8 
    'Fred'        9   10 
    The (lft, rgt) pairs are like tags in a mark-up language, or parens in algebra, BEGIN-END blocks in Algol-family programming languages, etc. -- they bracket a sub-set.  This is a set-oriented approach to trees in a set-oriented language. 
    The organizational chart would look like this as a directed graph:
                Albert (1, 12)
        Bert (2, 3)    Chuck (4, 11)
                       /    |   \
                     /      |     \
                   /        |       \
                 /          |         \
            Donna (5, 6) Eddie (7, 8) Fred (9, 10)
    The adjacency list table is denormalized in several ways. We are modeling both the Personnel and the Organizational chart in one table. But for the sake of saving space, pretend that the names are job titles and that we have another table which describes the
    Personnel that hold those positions.
    Another problem with the adjacency list model is that the boss_emp_name and employee columns are the same kind of thing (i.e. identifiers of personnel), and therefore should be shown in only one column in a normalized table.  To prove that this is not
    normalized, assume that "Chuck" changes his name to "Charles"; you have to change his name in both columns and several places. The defining characteristic of a normalized table is that you have one fact, one place, one time.
    The final problem is that the adjacency list model does not model subordination. Authority flows downhill in a hierarchy, but If I fire Chuck, I disconnect all of his subordinates from Albert. There are situations (i.e. water pipes) where this is true, but
    that is not the expected situation in this case.
    To show a tree as nested sets, replace the nodes with ovals, and then nest subordinate ovals inside each other. The root will be the largest oval and will contain every other node.  The leaf nodes will be the innermost ovals with nothing else inside them
    and the nesting will show the hierarchical relationship. The (lft, rgt) columns (I cannot use the reserved words LEFT and RIGHT in SQL) are what show the nesting. This is like XML, HTML or parentheses. 
    At this point, the boss_emp_name column is both redundant and denormalized, so it can be dropped. Also, note that the tree structure can be kept in one table and all the information about a node can be put in a second table and they can be joined on employee
    number for queries.
    To convert the graph into a nested sets model think of a little worm crawling along the tree. The worm starts at the top, the root, makes a complete trip around the tree. When he comes to a node, he puts a number in the cell on the side that he is visiting
    and increments his counter.  Each node will get two numbers, one of the right side and one for the left. Computer Science majors will recognize this as a modified preorder tree traversal algorithm. Finally, drop the unneeded OrgChart.boss_emp_name column
    which used to represent the edges of a graph.
    This has some predictable results that we can use for building queries.  The root is always (left = 1, right = 2 * (SELECT COUNT(*) FROM TreeTable)); leaf nodes always have (left + 1 = right); subtrees are defined by the BETWEEN predicate; etc. Here are
    two common queries which can be used to build others:
    1. An employee and all their Supervisors, no matter how deep the tree.
     SELECT O2.*
       FROM OrgChart AS O1, OrgChart AS O2
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND O1.emp_name = :in_emp_name;
    2. The employee and all their subordinates. There is a nice symmetry here.
     SELECT O1.*
       FROM OrgChart AS O1, OrgChart AS O2
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND O2.emp_name = :in_emp_name;
    3. Add a GROUP BY and aggregate functions to these basic queries and you have hierarchical reports. For example, the total salaries which each employee controls:
     SELECT O2.emp_name, SUM(S1.salary_amt)
       FROM OrgChart AS O1, OrgChart AS O2,
            Salaries AS S1
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND S1.emp_name = O2.emp_name 
       GROUP BY O2.emp_name;
    4. To find the level and the size of the subtree rooted at each emp_name, so you can print the tree as an indented listing. 
    SELECT O1.emp_name, 
       SUM(CASE WHEN O2.lft BETWEEN O1.lft AND O1.rgt 
       THEN O2.sale_amt ELSE 0.00 END) AS sale_amt_tot,
       SUM(CASE WHEN O2.lft BETWEEN O1.lft AND O1.rgt 
       THEN 1 ELSE 0 END) AS subtree_size,
       SUM(CASE WHEN O1.lft BETWEEN O2.lft AND O2.rgt
       THEN 1 ELSE 0 END) AS lvl
      FROM OrgChart AS O1, OrgChart AS O2
     GROUP BY O1.emp_name;
    5. The nested set model has an implied ordering of siblings which the adjacency list model does not. To insert a new node, G1, under part G.  We can insert one node at a time like this:
    BEGIN ATOMIC
    DECLARE rightmost_spread INTEGER;
    SET rightmost_spread 
        = (SELECT rgt 
             FROM Frammis 
            WHERE part = 'G');
    UPDATE Frammis
       SET lft = CASE WHEN lft > rightmost_spread
                      THEN lft + 2
                      ELSE lft END,
           rgt = CASE WHEN rgt >= rightmost_spread
                      THEN rgt + 2
                      ELSE rgt END
     WHERE rgt >= rightmost_spread;
     INSERT INTO Frammis (part, lft, rgt)
     VALUES ('G1', rightmost_spread, (rightmost_spread + 1));
     COMMIT WORK;
    END;
    The idea is to spread the (lft, rgt) numbers after the youngest child of the parent, G in this case, over by two to make room for the new addition, G1.  This procedure will add the new node to the rightmost child position, which helps to preserve the idea
    of an age order among the siblings.
    6. To convert a nested sets model into an adjacency list model:
    SELECT B.emp_name AS boss_emp_name, E.emp_name
      FROM OrgChart AS E
           LEFT OUTER JOIN
           OrgChart AS B
           ON B.lft
              = (SELECT MAX(lft)
                   FROM OrgChart AS S
                  WHERE E.lft > S.lft
                    AND E.lft < S.rgt);
    7. To find the immediate parent of a node: 
    SELECT MAX(P2.lft), MIN(P2.rgt)
      FROM Personnel AS P1, Personnel AS P2
     WHERE P1.lft BETWEEN P2.lft AND P2.rgt 
       AND P1.emp_name = @my_emp_name;
    I have a book on TREES & HIERARCHIES IN SQL which you can get at Amazon.com right now. It has a lot of other programming idioms for nested sets, like levels, structural comparisons, re-arrangement procedures, etc. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • What are the 3 openings for on the upper front of the phone

    I have been on the phone for over an hour trying to find out what the upper opening on the front of the iPhone 4s is. Please help.

    Big long oval with screen mesh inside is Earpiece Speaker, small oval to the side is FaceTime Camera, small elongate oval above Earpiece Speaker is the area of Proximity Sensor and Ambient Light Sensor.
    Proximity Sensor senses when your face is against screen during call. Ambient Light Sensor senses surrounding light to make adjustments to screen brightness if it is turned on.

  • Stored Procedure- Multil level employee hierarchy in the same row

    I have an employee table where I have employee details  which includes the following properties:
    EmployeeID, EmployeeName, ManagerID, DesignationCode.
    ManagerID maps to EmployeeID in the Emp table. DesignationCode is to identify the employee designation.
    The topmost person of the organization could be identified by : whose DesignationCode is 'XX' and ManagerID=EmplyeeID.
    Here, 'XX' is fixed and will not change.
    Also, we know there could be a maximum of 10 level for each hierarchy.
    Example: Employee1 reports to Manager1 who reports to Manager2 who reports to Manager 3 ..... who reports to ManagerN.
    I need to pull a hierarchy in the below format:
    EmpName  MgrName0   MagrName1   MgrName2 ..........MgrName7  MgrName8 
    MgrName9
    SAMRAT                                                                      
                                XXX                XXX
    SUDHAKAR                                                                   
      XXX                 XXX                XXX
    SATESWAR                                                                   
                              XXX                XXX
    SRINI               XXX                  XXX                      
              XXX                 XXX                XXX
    IMPORTANT POINT: We need to identify the reporting hierarchy level for each employee's manager and then place the manager names accordingly based on the columns.
    Example:
    If an employee's manager has only 1 reporting manager(who is at top level), then he would be placed at the column "ManagerName8" and ManageName9 would be the topmost employee of the organization
    In short, we need to identify the reporting level at which the employees manager belongs and then start filling the columns values for that row ( employee details)
    I am stuck and unable to do the same. Please help.
    Thank you.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    >> I have an employee table where I have employee details <<
    An SQL programmer would have a Personnel table instead. What you have said is that you have only one employee! 
    >> which includes the following properties:
    emp_id, emp_name, manager_emp_id, designation_code.<<
    Why do you think that a manager is an attribute of an employee? This is absurd! They have a relationship; where is the table that models that relationship? It is missing from this non-normalized, improperly designed table. 
    There are many ways to represent a tree or hierarchy in SQL. YOU are trying to use an adjacency list model. This approach will wind up with really ugly code -- CTEs hiding recursive procedures, horrible cycle prevention code, etc.  
    Another way of representing trees is to show them as nested sets. 
    Since SQL is a set oriented language, this is a better model than the usual adjacency list approach you see in most text books. Let us define a simple OrgChart table like this.
    CREATE TABLE OrgChart 
    (emp_name CHAR(10) NOT NULL PRIMARY KEY, 
     lft INTEGER NOT NULL UNIQUE CHECK (lft > 0), 
     rgt INTEGER NOT NULL UNIQUE CHECK (rgt > 1),
      CONSTRAINT order_okay CHECK (lft < rgt));
    OrgChart 
    emp_name         lft rgt 
    ======================
    'Albert'      1   12 
    'Bert'        2    3 
    'Chuck'       4   11 
    'Donna'       5    6 
    'Eddie'       7    8 
    'Fred'        9   10 
    The (lft, rgt) pairs are like tags in a mark-up language, or parens in algebra, BEGIN-END blocks in Algol-family programming languages, etc. -- they bracket a sub-set.  This is a set-oriented approach to trees in a set-oriented language. 
    The organizational chart would look like this as a directed graph:
                Albert (1, 12)
        Bert (2, 3)    Chuck (4, 11)
                       /    |   \
                     /      |     \
                   /        |       \
                 /          |         \
            Donna (5, 6) Eddie (7, 8) Fred (9, 10)
    The adjacency list table is denormalized in several ways. We are modeling both the Personnel and the Organizational chart in one table. But for the sake of saving space, pretend that the names are job titles and that we have another table which describes the
    Personnel that hold those positions.
    Another problem with the adjacency list model is that the boss_emp_name and employee columns are the same kind of thing (i.e. identifiers of personnel), and therefore should be shown in only one column in a normalized table.  To prove that this is not
    normalized, assume that "Chuck" changes his name to "Charles"; you have to change his name in both columns and several places. The defining characteristic of a normalized table is that you have one fact, one place, one time.
    The final problem is that the adjacency list model does not model subordination. Authority flows downhill in a hierarchy, but If I fire Chuck, I disconnect all of his subordinates from Albert. There are situations (i.e. water pipes) where this is true, but
    that is not the expected situation in this case.
    To show a tree as nested sets, replace the nodes with ovals, and then nest subordinate ovals inside each other. The root will be the largest oval and will contain every other node.  The leaf nodes will be the innermost ovals with nothing else inside them
    and the nesting will show the hierarchical relationship. The (lft, rgt) columns (I cannot use the reserved words LEFT and RIGHT in SQL) are what show the nesting. This is like XML, HTML or parentheses. 
    At this point, the boss_emp_name column is both redundant and denormalized, so it can be dropped. Also, note that the tree structure can be kept in one table and all the information about a node can be put in a second table and they can be joined on employee
    number for queries.
    To convert the graph into a nested sets model think of a little worm crawling along the tree. The worm starts at the top, the root, makes a complete trip around the tree. When he comes to a node, he puts a number in the cell on the side that he is visiting
    and increments his counter.  Each node will get two numbers, one of the right side and one for the left. Computer Science majors will recognize this as a modified preorder tree traversal algorithm. Finally, drop the unneeded OrgChart.boss_emp_name column
    which used to represent the edges of a graph.
    This has some predictable results that we can use for building queries.  The root is always (left = 1, right = 2 * (SELECT COUNT(*) FROM TreeTable)); leaf nodes always have (left + 1 = right); subtrees are defined by the BETWEEN predicate; etc. Here are
    two common queries which can be used to build others:
    1. An employee and all their Supervisors, no matter how deep the tree.
     SELECT O2.*
       FROM OrgChart AS O1, OrgChart AS O2
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND O1.emp_name = :in_emp_name;
    2. The employee and all their subordinates. There is a nice symmetry here.
     SELECT O1.*
       FROM OrgChart AS O1, OrgChart AS O2
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND O2.emp_name = :in_emp_name;
    3. Add a GROUP BY and aggregate functions to these basic queries and you have hierarchical reports. For example, the total salaries which each employee controls:
     SELECT O2.emp_name, SUM(S1.salary_amt)
       FROM OrgChart AS O1, OrgChart AS O2,
            Salaries AS S1
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND S1.emp_name = O2.emp_name 
       GROUP BY O2.emp_name;
    4. To find the level and the size of the subtree rooted at each emp_name, so you can print the tree as an indented listing. 
    SELECT O1.emp_name, 
       SUM(CASE WHEN O2.lft BETWEEN O1.lft AND O1.rgt 
       THEN O2.sale_amt ELSE 0.00 END) AS sale_amt_tot,
       SUM(CASE WHEN O2.lft BETWEEN O1.lft AND O1.rgt 
       THEN 1 ELSE 0 END) AS subtree_size,
       SUM(CASE WHEN O1.lft BETWEEN O2.lft AND O2.rgt
       THEN 1 ELSE 0 END) AS lvl
      FROM OrgChart AS O1, OrgChart AS O2
     GROUP BY O1.emp_name;
    5. The nested set model has an implied ordering of siblings which the adjacency list model does not. To insert a new node, G1, under part G.  We can insert one node at a time like this:
    BEGIN ATOMIC
    DECLARE rightmost_spread INTEGER;
    SET rightmost_spread 
        = (SELECT rgt 
             FROM Frammis 
            WHERE part = 'G');
    UPDATE Frammis
       SET lft = CASE WHEN lft > rightmost_spread
                      THEN lft + 2
                      ELSE lft END,
           rgt = CASE WHEN rgt >= rightmost_spread
                      THEN rgt + 2
                      ELSE rgt END
     WHERE rgt >= rightmost_spread;
     INSERT INTO Frammis (part, lft, rgt)
     VALUES ('G1', rightmost_spread, (rightmost_spread + 1));
     COMMIT WORK;
    END;
    The idea is to spread the (lft, rgt) numbers after the youngest child of the parent, G in this case, over by two to make room for the new addition, G1.  This procedure will add the new node to the rightmost child position, which helps to preserve the idea
    of an age order among the siblings.
    6. To convert a nested sets model into an adjacency list model:
    SELECT B.emp_name AS boss_emp_name, E.emp_name
      FROM OrgChart AS E
           LEFT OUTER JOIN
           OrgChart AS B
           ON B.lft
              = (SELECT MAX(lft)
                   FROM OrgChart AS S
                  WHERE E.lft > S.lft
                    AND E.lft < S.rgt);
    7. To find the immediate parent of a node: 
    SELECT MAX(P2.lft), MIN(P2.rgt)
      FROM Personnel AS P1, Personnel AS P2
     WHERE P1.lft BETWEEN P2.lft AND P2.rgt 
       AND P1.emp_name = @my_emp_name;
    I have a book on TREES & HIERARCHIES IN SQL which you can get at Amazon.com right now. It has a lot of other programming idioms for nested sets, like levels, structural comparisons, re-arrangement procedures, etc. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Start Event Triggers

    In BPMN 1.1 specification, there are 6 Start Event Types.
    I can Timer in BPM 10g studio.
    Does Message Wait and Send Message in BPM 10g implement Message trigger at BPMN 1.1?
    Where are None, Conditional, Signal, and Multiple in OBPM 10g?

    In BPMN 1.1 specification, there are 6 Start Event Types.I can Timer in BPM 10g studio.
    Does Message Wait and Send Message in BPM 10g implement Message trigger at BPMN 1.1?
    Where are None, Conditional, Signal, and Multiple in OBPM 10g? >
    It's a valid point. In Oracle BPM 10g, you can achieve the effect of the 6 BPMN start events, but the icons representing the most of the start events did not all show up in the process modeling tool until 11g.
    Plain - this event is the default Begin activity in the Oracle BPM 10g process. While BPMN 1.1 specifies that the first activity can be one of the 6 listed here, Oracle BPM 10g always uses the Plain start event in its model.
    Message - I know this is non-intuitive, but process instances can be created in a variety of different ways (e.g. PAPI, a subprocess flow invoking it, a Global Creation, logic from inside an activity, etc.). As it gets created you have a choice to use the default set of input arguments - this is the "BeginIn" mapping. Alternatively, you can create any number of other mappings with different sets of input argument variables. If you use an argument mapping other than the default "BeginIn", then you can right mouse click the Begin activity and click "Add a Message Based Transition". This creates a BPMN message transition. In Oracle BPM 10g you will see that the process still has a Plain start event, but in this scenario you will see a Message transition coming out of the Begin. It's functionally working the same, but modelled differently than what you might expect to see.
    Timer - this is one where the functionality is suppported but the icons do not show up in the process. You can create a timer start event by using a Global Automatic activity and setting it to create instances at specific times or intervals. Visually, you will see a Plain start event in the process, but you will also see a Global Automatic activity separate from the process. The Global Automatic controls the timer and is separate from the Begin activity. It's functionally working the same, but modelled differently than what you might expect to see.
    Conditional - this is supported somewhat from both modeling and execution. Again there is not Conditional start trigger. There is still a Plain start event, but you achieve the same result by adding a conditional transition and have it leave the Begin activity in the process. it's functionally working the same, but modelled differently than what you might expect to see.
    Signal - this is supported from inside the process, but the start event is handled by the Plain start event.
    Multiple - this too is supported from inside the process, but the start event for Multiple is also caught by the Plain start event.
    Dan

  • Reading Data : LoadVars

    I want to read data from several files whose names are
    written in array
    then I want to get an array with names of those file whose
    content length is
    more than 1000.
    I have done looping and able to get data of files and check
    their length but
    not able to store the file name.
    this is happing probably becoz onLoad of loadvars is not
    gtting called in
    loop sequentilayy so that i can get the file name there
    itself , but onLoad
    is getting called one by one after the loop finishs .here the
    file name is
    lost.
    How to do !!!!!!!!!!!!!!!!!!11

    let me say first the problem is solved :) .
    But we even could not use boolean since loadis call in
    condition if
    condition false the would not load in that case false val and
    if condition
    true then true will be passed to handler function even in
    first go.!!! so
    that won't work.
    Second the list box path dint work if i used relativ path
    this.pah.list_combo.
    but worked if used absolute path _root.path.list_combo.. I
    dont know why
    but it it is working.
    "GWD" <[email protected]> wrote in message
    news:f6crko$kle$[email protected]..
    >
    quote:
    I had the same idea but i cannot hardcode the value like if
    > (LV.loadIndex==1000) .the newLV.load(nextToLoad); is
    called in a loop
    > where
    > some condition are checked and then newLV.load called so
    not able to
    > assign
    > value of loop to lv.
    >
    > OK then... instead of a loadIndex property, just assign
    a boolean .isLast
    > value to each LoadVars. If its not the last one should
    always be false.
    > The
    > only one with a true value assigned should be the last
    one in the LoadVars
    > creation loop.
    >
    > inside the onLoad handler, instead of
    > if (LV.loadIndex==1000)
    > use
    > if (LV.isLast)
    >
    >
    quote:
    2) the list box is on same time line and i am using
    > this.list_combo.addItem({label:"Label", data:"data"});
    > to populate list component.
    > I know it is correct , i debugged too but still not
    adding items to
    > combo.Is
    > there some timing related issues with lv and list.
    >
    > try :
    > list_combo.addItem({label:"Label", data:"data"});
    > instead of :
    > this.list_combo.addItem({label:"Label", data:"data"});
    >
    > If that doesn't work then post your code
    >

Maybe you are looking for