Formating and operating with integer values

I am new to XML Publisher.
I have a task to make a layout using rtf. The problem is that I must do an arithmetical operation using data generated from a system report. I must not modify the report!!!
The value retrieved from report is of X.Y format which means a time period (X - years, Y - months). So I want to split this value in two - one for years and other for months with a posibility of making arithmetical operations over them. Is it possible?? And if so, cand anybody give me a solution for this...?

ok, back to the problem. As I red in the XML Publihser Users Guide there is a posibility to transform strings in numbers, but I can't figure out how it works! As speaking of my problem I can not do arithmetical operations with that value (YEARS.MONTHS). I tried the to_number function described in XML Publisher User's Guide (page 7-3) over the vlaue x.y, I tried to change the point (x.y) to a comma (x,y) and again aply to_number function over resulted value, but it doesn't work. What do I do wrong?
I tried the solution of spliting the x from y, but I run into a problem again. The years part x has a variable length so I can't get the y part. (the substr function didn't worked with negative start position - substr(DATE, -3, 3))
Generaly I'm a very confused about XML Publisher. There are examples in User's Guide which didn't work for me...
If anybody has some links with documentation about XML Publisher, other than those from ORACLE, please share them with me.
10x!

Similar Messages

  • Sql query slowness due to rank and columns with null values:

        
    Sql query slowness due to rank and columns with null values:
    I have the following table in database with around 10 millions records:
    Declaration:
    create table PropertyOwners (
    [Key] int not null primary key,
    PropertyKey int not null,    
    BoughtDate DateTime,    
    OwnerKey int null,    
    GroupKey int null   
    go
    [Key] is primary key and combination of PropertyKey, BoughtDate, OwnerKey and GroupKey is unique.
    With the following index:
    CREATE NONCLUSTERED INDEX [IX_PropertyOwners] ON [dbo].[PropertyOwners]    
    [PropertyKey] ASC,   
    [BoughtDate] DESC,   
    [OwnerKey] DESC,   
    [GroupKey] DESC   
    go
    Description of the case:
    For single BoughtDate one property can belong to multiple owners or single group, for single record there can either be OwnerKey or GroupKey but not both so one of them will be null for each record. I am trying to retrieve the data from the table using
    following query for the OwnerKey. If there are same property rows for owners and group at the same time than the rows having OwnerKey with be preferred, that is why I am using "OwnerKey desc" in Rank function.
    declare @ownerKey int = 40000   
    select PropertyKey, BoughtDate, OwnerKey, GroupKey   
    from (    
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,       
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]   
    from PropertyOwners   
    ) as result   
    where result.[Rank]=1 and result.[OwnerKey]=@ownerKey
    It is taking 2-3 seconds to get the records which is too slow, similar time it is taking as I try to get the records using the GroupKey. But when I tried to get the records for the PropertyKey with the same query, it is executing in 10 milliseconds.
    May be the slowness is due to as OwnerKey/GroupKey in the table  can be null and sql server in unable to index it. I have also tried to use the Indexed view to pre ranked them but I can't use it in my query as Rank function is not supported in indexed
    view.
    Please note this table is updated once a day and using Sql Server 2008 R2. Any help will be greatly appreciated.

    create table #result (PropertyKey int not null, BoughtDate datetime, OwnerKey int null, GroupKey int null, [Rank] int not null)Create index idx ON #result(OwnerKey ,rnk)
    insert into #result(PropertyKey, BoughtDate, OwnerKey, GroupKey, [Rank])
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]
    from PropertyOwners
    go
    declare @ownerKey int = 1
    select PropertyKey, BoughtDate, OwnerKey, GroupKey
    from #result as result
    where result.[Rank]=1
    and result.[OwnerKey]=@ownerKey
    go
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Database Adapter insert operation with return value

    Hi All,
    I have a table with auto generate parimary key in DB2 database. I need to have an insert operation ont this table which should return current value of primary key after insert.
    For this , I have created an insert operation in DB Adapter. But this insert operation in oneway operation.
    Is there any way I can create an Insert operation in DB2 adapter which returns the primary key value?
    Thanks
    --Sree                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi Sree,
    With insert operation it is not possible. You may use stored procedure/function to perform insert and return the required value, and call this SP/function using DB Adapter.
    Regards,
    Anuj

  • How to export "Managed by" field of Distribution and Security groups and import with new values? (Exchange 2010, AD 2003)

    My Active Directory environment is 2003 functional level and we have Exchange 2010.
    I am trying to find out the best way to do a mass edit for the "Managed by" values of our security and distribution groups.
    I know we can export the "managed by" field by csvde but I am not sure this is the correct way to do it. Also in the case that there are multiple users assigned to be managing a distribution group it only shows one value. Also powershell from Exchange
    2010 can be used with "get-distribution" but as our AD environment is 2003 is this correct also?
    Finally once the data is exported to csv can it be edited to then reimport and udpate the existing group managed by fields with new values?
    Not really sure that the best way to go about this is.
    Summary - We have 2003 AD with Exchange 2010 and I am trying to export a list of all our Distribution/Security groups showing the group name and managedby values so we can edit and update the
    existing managedby values with new ones. In some cases we have multiple users as the owners.
    Appreciate any advice on how this can be best achieved. Thank you.

    Hi,
    We can use the following command in Exchange 2010 to export "Managed by" field of Distribution and Security groups:
    Get-DistributionGroup | Select-object Name,@{label="ManagedBy";expression={[string]::join(“;”,$_.managedby)}},Primarysmtpaddress | Export-Csv
    C:\export.csv
    After you changed the Managed by field in export.csv and saved it as a new file named import.csv, we can run the following command to set with new value:
    Import-Csv C:\import.csv | Foreach-Object{ Set-DistributionGroup –Identity $_.Name –ManagedBy $_.ManagedBy}
    Hope it works.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • How to export "Managed by" field of Distribution and Security groups and import with new values?

    My Active Directory environment is 2003 functional level and we have Exchange 2010.
    I am trying to find out the best way to do a mass edit for the "Managed by" values of our security and distribution groups.
    I know we can export the "managed by" field by csvde but I am not sure this is the correct way to do it. Also in the case that there are multiple users assigned to be managing a distribution group it only shows one value. Also powershell from Exchange
    2010 can be used with "get-distribution" but as our AD envronment is 2003 is this correct also?
    Finally once the data is exported to csv can it be edited to then reimport and udpate the existing group managed by fields with new values?
    Not really sure that the best way to go about this is.
    Summary - We have 2003 AD with Exchange 2010 and I am trying to export a list of all our Distribution/Security groups showing the group name and managedby values so we can edit and update the
    existing managedby values with new ones.
    Appreciate any advice on how this can be best achieved. Thank you.

    Hi Barkley,
    You can also refer to Official Scripting Guys forum to get a script solution:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG&filter=alltypes&sort=lastpostdesc
    Best Regards,
    Amy Wang

  • And operation in extract value

    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    TNS for Solaris: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    This is my input xml
    - <OLifE>
    - <SourceInfo>
    <SourceInfoName>Client Profile</SourceInfoName>
    </SourceInfo>
    - <Activity id="Act1" PartyID="Party1">
    <ActivityStatus tc="2">In Progress</ActivityStatus>
    <UserCode>123456</UserCode>
    <Opened>2010-08-17</Opened>
    <ActivityCode>CP10001</ActivityCode>
    - <Attachment>
    <Description>LastScreenName</Description>
    <AttachmentData>CP Create</AttachmentData>
    <AttachmentType tc="2">OLI_ATTACH_COMMENT</AttachmentType>
    <AttachmentLocation tc="1">OLI_INLINE</AttachmentLocation>
    </Attachment>
    - <OLifEExtension VendorCode="05" ExtensionCode="Activity">
    - <ActivityExtension>
    <SubActivityCode>CP20001</SubActivityCode>
    </ActivityExtension>
    </OLifEExtension>
    </Activity>
    - <Relation OriginatingObjectID="Holding1" id="Relation4" RelatedObjectID="Party1">
    <OriginatingObjectType tc="4">Holding</OriginatingObjectType>
    <RelatedObjectType tc="6">Party</RelatedObjectType>
    <RelationRoleCode tc="8">Owner</RelationRoleCode>
    </Relation>
    Here xml_data_val is the input xml.
    BEGIN
    SELECT extractvalue(value(t),'OLifE/Activity[@PartyID=/OLifE/Relation[RelationRoleCode/@tc=8]/@RelatedObjectID]/ActivityStatus/@tc'),
    extractvalue(value(t),'/OLifE/Activity[@PartyID=/OLifE/Relation[RelationRoleCode/@tc=8]/@RelatedObjectID]/Opened'),
    extractvalue(value(t),'/OLifE/Activity[@PartyID=/OLifE/Relation[RelationRoleCode/@tc=8]/@RelatedObjectID AND /OLifE/Activity/ActivityCode=CP10001]/UserCode'),
    extract(value(t),'/OLifE'),
    extractvalue(value(t),'/OLifE/Relation[RelationRoleCode/@tc=8]/@RelatedObjectID')
    INTO nActstat,
    vDate,
    vUsercreated,
    xml_data_val,
    vPartyid
    FROM TABLE
    XMLSEQUENCE
    EXTRACT (xml_data_val,'/TXLife/TXLifeRequest/OLifE')
    )t;
    dDate:=TO_DATE(vDate,'YYYY-MM-DD');
    Exception
    WHEN OTHERS THEN
    ncode:=5;
         nErrcode:=2003;
    vStatus:='FAILURE';
         vStatusinfo:='Required Element Missing';
         Raise_application_error(-20201,'Required information not available');
    END;
    I am facing problem here is i am not able to retrive UserCode value.
    Edited by: user13444979 on Dec 13, 2010 8:09 AM

    Is this what you are looking for ?
    SQL> column ACTIVITY format A80
    SQL> --
    SQL> set lines 256 long 10000
    SQL> --
    SQL> VAR XMLTEXT CLOB
    SQL> --
    SQL> begin
      2    :XMLTEXT :=
      3  '<TXLife Version="2.15.00" xmlns="http://ACORD.org/Standards/Life/2">
      4     <UserAuthRequest>
      5             <UserLoginName>CPUser</UserLoginName>
      6     </UserAuthRequest>
      7     <TXLifeRequest>
      8             <TransRefGUID>10bc80e7d60e59b0:a134d0:10d7c4674ad:-7ffc</TransRefGUID>
      9             <TransType tc="301">OLI_TRANS_SRCPAR</TransType>
    10             <TransExeDate>2010-08-24</TransExeDate>
    11             <TransExeTime>12:01:01</TransExeTime>
    12             <InquiryLevel tc="3">OLI_INQUIRY_OBJRELOBJ</InquiryLevel>
    13             <InquiryView>
    14                     <InquiryViewCode>CS-301-002</InquiryViewCode>
    15             </InquiryView>
    16             <MaxRecords>20</MaxRecords>
    17             <CriteriaExpression>
    18                     <CriteriaOperator tc="2">AND</CriteriaOperator>
    19                     <Criteria>
    20                             <ObjectType tc="6">Party</ObjectType>
    21                             <PropertyName>LastName</PropertyName>
    22                             <PropertyValue>AXA</PropertyValue>
    23                             <Operation tc="1">OLI_OP_EQUAL</Operation>
    24                     </Criteria>
    25                     <Criteria>
    26                             <ObjectType tc="6">Party</ObjectType>
    27                             <PropertyName>GovtID</PropertyName>
    28                             <PropertyValue>123456789</PropertyValue>
    29                             <Operation tc="1">OLI_OP_EQUAL</Operation>
    30                     </Criteria>
    31                     <Criteria>
    32                             <ObjectType tc="6">Party</ObjectType>
    33                             <PropertyName>GovtIDTc</PropertyName>
    34                             <PropertyValue>1</PropertyValue>
    35                             <Operation tc="1">OLI_OP_EQUAL</Operation>
    36                     </Criteria>
    37                     <Criteria>
    38                             <ObjectType tc="6">Party</ObjectType>
    39                             <PropertyName>ResidenceState</PropertyName>
    40                             <PropertyValue>AL</PropertyValue>
    41                             <Operation tc="1">OLI_OP_EQUAL</Operation>
    42                     </Criteria>
    43                     <CriteriaExpression>
    44                             <CriteriaOperator tc="2">AND</CriteriaOperator>
    45                             <Criteria>
    46                                     <ObjectType tc="7">Activity</ObjectType>
    47                                     <PropertyName>ActivityTypeCode</PropertyName>
    48                                     <PropertyValue>CIH10028</PropertyValue>
    49                                     <Operation tc="1">OLI_OP_EQUAL</Operation>
    50                             </Criteria>
    51                             <Criteria>
    52                                     <ObjectType tc="7">Activity</ObjectType>
    53                                     <PropertyName>ActivityDescription</PropertyName>
    54                                     <PropertyValue>CIH50167</PropertyValue>
    55                                     <Operation tc="1">OLI_OP_EQUAL</Operation>
    56                             </Criteria>
    57                             <Criteria>
    58                                     <ObjectType tc="7">Activity</ObjectType>
    59                                     <PropertyName>UserCode</PropertyName>
    60                                     <PropertyValue>123456</PropertyValue>
    61                                     <Operation tc="1">OLI_OP_EQUAL</Operation>
    62                             </Criteria>
    63                     </CriteriaExpression>
    64                     <CriteriaExpression>
    65                             <CriteriaOperator tc="2">AND</CriteriaOperator>
    66                             <Criteria>
    67                                     <ObjectType tc="7">Activity</ObjectType>
    68                                     <PropertyName>ActivityTypeCode</PropertyName>
    69                                     <PropertyValue>CIH10028</PropertyValue>
    70                                     <Operation tc="1">OLI_OP_EQUAL</Operation>
    71                             </Criteria>
    72                             <Criteria>
    73                                     <ObjectType tc="7">Activity</ObjectType>
    74                                     <PropertyName>ActivityStatus</PropertyName>
    75                                     <PropertyValue>4</PropertyValue>
    76                                     <Operation tc="1">OLI_OP_EQUAL</Operation>
    77                             </Criteria>
    78                     </CriteriaExpression>
    79                     <CriteriaExpression>
    80                             <CriteriaOperator tc="2">AND</CriteriaOperator>
    81                             <Criteria>
    82                                     <ObjectType tc="7">Activity</ObjectType>
    83                                     <PropertyName>ActivityTypeCode</PropertyName>
    84                                     <PropertyValue>CIH10028</PropertyValue>
    85                                     <Operation tc="1">OLI_OP_EQUAL</Operation>
    86                             </Criteria>
    87                             <Criteria>
    88                                     <ObjectType tc="7">Activity</ObjectType>
    89                                     <PropertyName>Closed</PropertyName>
    90                                     <PropertyValue>2010-08-16</PropertyValue>
    91                                     <Operation tc="4">OLI_OP_GREATERTHAN</Operation>
    92                             </Criteria>
    93                             <Criteria>
    94                                     <ObjectType tc="7">Activity</ObjectType>
    95                                     <PropertyName>Closed</PropertyName>
    96                                     <PropertyValue>2010-08-24</PropertyValue>
    97                                     <Operation tc="3">OLI_OP_LESSTHAN</Operation>
    98                             </Criteria>
    99                     </CriteriaExpression>
    100             </CriteriaExpression>
    101             <OLifE>
    102                     <SourceInfo>
    103                             <SourceInfoName>Client Profile</SourceInfoName>
    104                     </SourceInfo>
    105                     <Activity id="Act1" PartyID="Party1">
    106                             <ActivityStatus tc="2">In Progress</ActivityStatus>
    107                             <UserCode>123456</UserCode>
    108                             <Opened>2010-08-17</Opened>
    109                             <ActivityCode>CP10001</ActivityCode>
    110                             <Attachment>
    111                                     <Description>LastScreenName</Description>
    112                                     <AttachmentData>CP Create</AttachmentData>
    113                                     <AttachmentType tc="2">OLI_ATTACH_COMMENT</AttachmentType>
    114                                     <AttachmentLocation tc="1">OLI_INLINE</AttachmentLocation>
    115                             </Attachment>
    116                             <OLifEExtension VendorCode="05" ExtensionCode="Activity">
    117                                     <ActivityExtension>
    118                                             <SubActivityCode>CP20001</SubActivityCode>
    119                                     </ActivityExtension>
    120                             </OLifEExtension>
    121                     </Activity>
    122                     <Relation OriginatingObjectID="Holding1" id="Relation4" RelatedObjectID="Party1">
    123                             <OriginatingObjectType tc="4">Holding</OriginatingObjectType>
    124                             <RelatedObjectType tc="6">Party</RelatedObjectType>
    125                             <RelationRoleCode tc="8">Owner</RelationRoleCode>
    126                     </Relation>
    127             </OLifE>
    128     </TXLifeRequest>
    129  </TXLife>';
    130  end;
    131  /
    PL/SQL procedure successfully completed.
    SQL> column XML FORMAT A128
    SQL> set heading on lines 256 pages 20 long 10000
    SQL> --
    SQL> with TXLIFE_TABLE
      2  as
      3  (
      4    select XMLTYPE(:XMLTEXT) as OBJECT_VALUE
      5      from DUAL
      6  )
      7  select NACTSTAT, VPARTYID, VDATE, VUSERCREATED,
      8         XMLSERIALIZE(DOCUMENT ACTIVITY AS CLOB INDENT SIZE=2) ACTIVITY
      9    from TXLIFE_TABLE,
    10         XMLTable
    11         (
    12           xmlNamespaces
    13           (
    14             default 'http://ACORD.org/Standards/Life/2'
    15           ),
    16           'for $OLifE in $TX/TXLife/TXLifeRequest/OLifE
    17             for $RELATION in $OLifE/Relation[RelationRoleCode/@tc=8], $ACTIVITY in $OLifE/Activity[@PartyID=$RELATION/@RelatedObjectID and ActivityCode="CP10001"]
    18               return
    19                 <Result>
    20                 {
    21                   <ACTSTAT>{fn:data($ACTIVITY/ActivityStatus/@tc)}</ACTSTAT>,
    22                   <PARTYID>{fn:data($RELATION/@RelatedObjectID)}</PARTYID>,
    23                   $ACTIVITY/Opened,
    24                   $ACTIVITY/UserCode,
    25                   $ACTIVITY
    26                 }
    27                 </Result>'
    28           passing OBJECT_VALUE as "TX"
    29           columns
    30           NACTSTAT        NUMBER(2) PATH 'ACTSTAT',
    31           VPARTYID     VARCHAR2(10) PATH 'PARTYID',
    32           VDATE                DATE PATH 'Opened',
    33           VUSERCREATED VARCHAR2(20) PATH 'UserCode',
    34           ACTIVITY          XMLTYPE PATH 'Activity'
    35         ) t
    36  /
      NACTSTAT VPARTYID   VDATE     VUSERCREATED         ACTIVITY
             2 Party1     17-AUG-10 123456               <Activity xmlns="http://ACORD.org/Standards/Life/2" id="Act1" PartyID="Party1">
                                                           <ActivityStatus tc="2">In Progress</ActivityStatus>
                                                           <UserCode>123456</UserCode>
                                                           <Opened>2010-08-17</Opened>
                                                           <ActivityCode>CP10001</ActivityCode>
                                                           <Attachment>
                                                             <Description>LastScreenName</Description>
                                                             <AttachmentData>CP Create</AttachmentData>
                                                             <AttachmentType tc="2">OLI_ATTACH_COMMENT</AttachmentType>
                                                             <AttachmentLocation tc="1">OLI_INLINE</AttachmentLocation>
                                                           </Attachment>
                                                           <OLifEExtension VendorCode="05" ExtensionCode="Activity">
                                                             <ActivityExtension>
                                                               <SubActivityCode>CP20001</SubActivityCode>
                                                             </ActivityExtension>
                                                           </OLifEExtension>
                                                         </Activity>
      NACTSTAT VPARTYID   VDATE     VUSERCREATED         ACTIVITY
    SQL>

  • About checkbox and calculation with that value..pls help me ...

    Hi, in my applet there are three checkboxes about food shape which is wanted to be selected by the user. The user will choose one of them and by his/her choice p and r values are set and i think its done by itemStateChange method. In this method using by if the p and r values are differently set because of users different 3 choice. But because the method is closed using }after writing it and before starting actionperformed method. In action performed method if button is pressed the calculation is done (if i would afford to write it in a true way). My question arises with usage of p and r values which is set in other first method and call it in next method and use it in calculation and making the calculation work. May be it is very easy to do it but not for me being at first step of programming. Thank u for all of ur interest. My codes are below:
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.Applet;
    import java.text.*;
    public class kenan extends Applet implements ActionListener, ItemListener {
    DecimalFormat df=new DecimalFormat("0.####");
    double p, r;
    Panel satir1 = new Panel();
    Label l1 = new Label("Asagidaki kutulara gerekli degerleri girip 'hesapla' butonuna bas&#305;n&#305;z", Label.CENTER);
    Panel satir2 = new Panel();
    CheckboxGroup sekil = new CheckboxGroup();
    Checkbox levha = new Checkbox("Levha", false, sekil);
    Checkbox silindir = new Checkbox("Silindir", false, sekil);
    Checkbox kure = new Checkbox("Kure", false, sekil);
    Panel satir3 = new Panel();
    Label yogunluk = new Label("Yogunluk");
    TextField y = new TextField();
    Label kalinlik = new Label("Kalinlik");
    TextField dx = new TextField();
    Label iletim = new Label("Iletim katsayisi");
    TextField k = new TextField();
    Label tasinim = new Label("Tasinim katsayisi");
    TextField h = new TextField();
    Label ilksicaklik = new Label("Baslangic sicakligi");
    TextField tilk = new TextField();
    Label cevresicaklik = new Label("Cevre sicakligi");
    TextField tcevre = new TextField();
    Panel satir4 = new Panel();
    Button hesapla = new Button("Hesapla");
    Panel satir5 = new Panel();
    Label sure = new Label("Donma icin gecmesi gereken sure");
    Label tdonma = new Label("t");
    public void init(){
    GridLayout appletLayout = new GridLayout(5, 1, 5, 5);
    setLayout(appletLayout);
    FlowLayout layout1 = new FlowLayout(FlowLayout.LEFT, 5, 5);
    satir1.setLayout(layout1);
    satir1.add(l1);
    add(satir1);
    FlowLayout layout2 = new FlowLayout(FlowLayout.LEFT, 5, 5);
    satir2.setLayout(layout2);
    satir2.add(levha);
    satir2.add(silindir);
    satir2.add(kure);
    add(satir2);
    GridLayout layout3 = new GridLayout(3, 2, 5, 5);
    satir3.setLayout(layout3);
    satir3.add(yogunluk);
    satir3.add(y);
    satir3.add(kalinlik);
    satir3.add(dx);
    satir3.add(iletim);
    satir3.add(k);
    satir3.add(tasinim);
    satir3.add(h);
    satir3.add(ilksicaklik);
    satir3.add(tilk);
    satir3.add(cevresicaklik);
    satir3.add(tcevre);
    add(satir3);
    FlowLayout layout4 = new FlowLayout(FlowLayout.CENTER, 5, 5);
    satir4.setLayout(layout4);
    satir4.add(hesapla);
    add(satir4);
    FlowLayout layout5 = new FlowLayout(FlowLayout.CENTER, 5, 5);
    satir5.setLayout(layout5);
    satir5.add(sure);
    satir5.add(tdonma);
    add(satir5);
    setBackground(Color.lightGray);
    hesapla.addActionListener(this);
    levha.addItemListener(this);
    silindir.addItemListener(this);
    kure.addItemListener(this);
    public void itemStateChanged(ItemEvent event)
    String command = (String) event.getItem();
    if (command =="levha")
    {double p = 1/2;
    double r = 1/8;
    if (command =="Silindir")
    {double p = 1/4;
    double r = 1/16;
    else
    {double p = 1/6;
    double r = 1/24;}
    public void actionPerformed(ActionEvent event)
    {if (event.getSource()==hesapla)
    {double q,d,ti,tc,ki,hc;
    q = Double.valueOf(y.getText()).doubleValue();
    d = Double.valueOf(dx.getText()).doubleValue();
    ti = Double.valueOf(tilk.getText()).doubleValue();
    tc = Double.valueOf(tcevre.getText()).doubleValue();
    hc = Double.valueOf(h.getText()).doubleValue();
    ki = Double.valueOf(k.getText()).doubleValue();
    double buzE = 333707.99;
    double x = r*(Math.pow(d,2));
    double tsure = (q*buzE/(ti-tc))*((p*d/hc)+(x/ki));
    tdonma.setText(String.valueOf(df.format(tsure)));
    }

    First thing to fix is in itemStateChanged, use "equals" instead of "=="
    if (command.equals("levha"))
    else if (command.equals(...))
    Second thing is:
    double r = 1/2;is really telling Java the following:
    int tempR = 0; //integer division of 1/2;
    double r = (double) tempR = 0;Use:
    double r = ((double) 1)/2; // or just use 1.0/2.0;-------------
    Third thing is that your declarations of r and p in itemStateChanged hide the declaration of r and p in your kenan class. Just say:
    r = ((double) 1)/2; // or "r = 1.0/2.0;"-------------
    Try those three things, see what happens, and post the results.

  • SelectOneListbox with Integer value?

    Hello
    Maybe I'm stupid... I'm trying to do the following, where #{searchBean.filter.role.code} is of type Integer:
    <m:selectOneListbox id="role" size="1"
         value="#{searchBean.filter.role.code}">
         <f:selectItem itemLabel="VN" itemValue="417" />
         <f:selectItem itemLabel="PI" itemValue="415" />
    </m:selectOneListbox>
    I'm getting the following exception:
    java.lang.ClassCastException: java.lang.String
    I tried with some converters but could not find a solution. It seems that the value of the selectedItems are String and jsf cannot convert the code to String. But why?
    I hope someone can help. Thanks!
    Oliver

    What is it, the 'm' taglib? Is it the Sun JSF implementation? Why aren't you using the 'h' prefix?
    Anyway, the given code should just work, assuming that #{searchBean.filter.role.code} is actually mapped to java.lang.Integer and not null. But I recall some related bugs in one of the ancient JSF RI versions. Which implementation/version are you using? It might be worth upgrading to the latest. If you're using Sun RI 1.0 or 1.1, get the 1.1_02 here: [http://javaserverfaces.dev.java.net]. If your're using Sun RI 1.2 (Mojarra), or if your environment supports Servlet 2.5 / JSP 2.1, then get the latest 1.2 build (currently 1.2_09) from the same site.
    Said that, did you know that you can also just use a <h:selectOneMenu /> instead of a <h:selectOneListbox size="1" />? They are both effectively the same.

  • Vision DevMod: How to create large Gaussian filter kernels with integer values like Vision Assistant uses

    Hello,
    in Vision Assistant it is possible to create filter kernel of arbitrary size, like e.g. a 75x75 Gaussian kernel. These kernels feature integer-only elements. I tried to find a function in the Vision Development Module, but have been unable to find something so far. So I still create a Vision Assistant script with such a kernel and export it to a LabVIEW VI in order to abtain such a kernel. Any ideas on how to create such kernels programmatically?

    -You can generate custom kernels in LabVIEW also, but you need to have either string or numerical of that kernels. Without these two, i am not sure of how to do this.
    -Please check this for building kernels.
    http://zone.ni.com/reference/en-XX/help/370281M-01​/imaqvision/imaq_buildkernel/
    -Let's say you are able to programmatically generate kernel string, it will convert to kernel in double format automatically and connect this to convolute vi.
    Thanks
    uday,
    Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
    Certified LabVIEW Associate Developer (CLAD) Using LV13

  • How to ignore error and continue with next value in PL/SQL FOR loop?

    hi,
    When the DROP INDEX statement fails it have to continue with the next value in FOR loop without exiting from the loop. Can anyone tell me how to do this?
    DECLARE
    CURSOR aud_cur IS
    SELECT key_col_idx FROM audience_work where aud_ref_id between 106 and 109;
    BEGIN
    FOR aud_row IN aud_cur LOOP
    EXECUTE IMMEDIATE
    'DROP INDEX ' || aud_row.key_col_idx;
    END LOOP;
    END;
    Thanks,
    Noble

    DECLARE
      CURSOR aud_cur
      IS
      SELECT key_col_idx FROM audience_work where aud_ref_id between 106 and 109;
    BEGIN
      FOR aud_row IN aud_cur LOOP
        begin
          EXECUTE IMMEDIATE 'DROP INDEX ' || aud_row.key_col_idx;
        exception
          when others then
            if sqlcode = -01418 then
              dbms_output.put_line(' index does not exist ');
            else
              dbms_output.put_line(sqlcode);
              raise;
            end if; 
        end;
      END LOOP;
    END;
    /

  • Dead hard drive-how to format and startup with new disk

    I have a 9 month old non-retina MBP. I replaced the HD with an SSD when I bought it. It seems the SSD has stopped working and I need to replace it. Grrr. I do have a Time Capsule backup that I can use, but how do I install the OS on the replacement SSD? After I have the MBP running with the new SSD, I should be able to reinstall everything else from the Time Capsule backup. I have another MBP that I can use for assistance/transferring/formatting if this will be helpful. Will Apple store Genius help me to do this? I would not be surprised that any warranty coverage may have been voided when I installed the SSD. I could use the other MBP to format the new SSD before installing it.

    Your computer has got Internet Recovery. Use it to restore your backup.
    To start in Internet Recovery, hold Command, Option (Alt) and R keys while your computer is starting. Then, open Disk Utility, choose your hard disk at the top of the sidebar, go to Erase tab and erase the disk using "Mac OS Extended (Journaled)" as format.
    Finally, close Disk Utility, plug the external disk with your backup, select the option to restore a Time Machine backup and follow its steps

  • Fetch the column title and evaluate with another value.

    Hi all,
    I am new to SAP SDK and am trying to populate the Forecast matrix with quantities for items defined in Sales Order and for the delivery date mentioned in SO.
    I want to fill in the quantities for the respective item code in the date column of Forecast.
    For ex: Sales Order has an item M which has a delivery date of say 15/12/2010 and quantity as 100 then when i want to fill this in Forecast how do i fill 100 Qty in the column with title date as 15/12/2010?
    As the column id are all variables in Forecast screen how best can i search for a particular date in the number of columns via code.
    Sample code if provided will be useful..
    Thanks in advance
    Regards
    Rohan S Kamble

    The following link might help you in achieving this
    Re: Make the column title with value month_year based on the fiscal year/period

  • How to find and replace with sequential values?

    im building a website. it contains 12 main images per page and luckily according to my design the source code per page contains 12 <img> tags only (rest is background and stuff). now for many pages i keep using a particular page as template and then change each and every image by browsing and clicking. Now i want to make my work easy.
    the images that i want to add in every page are sequentially file named.  001.jpg , 002.jpg .......... and so on.
    So is there some way that i can use find and replace , to find the <img> tags and fill them all with values sequentially that is the first <img> tag containts 001.jpg and the second containts 002,jpg and so on .
    the pages are many thats why i want to make this easy
    thanks very much for help

    Will they ever do this?   I just wish Adobe would purchase TextPad and integrate it into Dreamweaver.  In TextPad, from the manual:
    Other TextPad options in the replacement string:
    \i Generate a sequence number.
    \i(N,M) Ditto, starting at N and incrementing by M.
    So beautifully simple.

  • Crash of Oracle XE when check constraint uses in-operator with desc. values

    ORA-03113 and other errors in conjunction with lost of connection occur in Oracle XE under the following conditions:
    /* Crash (values of check constraint in descending order) */
    DROP TABLE CRASHTEST CASCADE CONSTRAINTS;
    CREATE TABLE CRASHTEST
    CRASHTEST_ID NUMBER(9),
    CRASHTEST_OK NUMBER(1) DEFAULT 0
    ALTER TABLE CRASHTEST ADD (CONSTRAINT CRASHTEST_CK CHECK (CRASHTEST_OK IN (0,-1)));
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (1, 0);
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (2, -1);
    COMMIT;
    SELECT * FROM CRASHTEST WHERE CRASHTEST_OK = 0;
    If all values of the in-clause within the check constraint are entered in ascending order, no error occurs:
    /* No Crash (values of check constraint in ascending order) */
    DROP TABLE CRASHTEST CASCADE CONSTRAINTS;
    CREATE TABLE CRASHTEST
    CRASHTEST_ID NUMBER(9),
    CRASHTEST_OK NUMBER(1) DEFAULT 0
    ALTER TABLE CRASHTEST ADD (CONSTRAINT CRASHTEST_CK CHECK (CRASHTEST_OK IN (-1,0)));
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (1, 0);
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (2, -1);
    COMMIT;
    SELECT * FROM CRASHTEST WHERE CRASHTEST_OK = 0;
    Especially interesting is the fact, that the error is caused by a check constraint in conjunction with a select statement!
    Hopefully, there are no other hidden bombs stealing my time...
    Have a nice day,
    Sven

    It might be interesting to post that in the XE forum to notify Oracle developers and XE users.
    Oracle Database Express Edition (XE)
    C.

  • Formating and calculating xml tag value

    I have an xml file that holds xml tag such as <weight>.55 kg</weight>
    I want to have two outputs:
    Output 1) Output to print: 0.55
    Output 2) Output to print 0.8 of the xml tag value (0.55 * 0.8) : 0.44
    I was able to get the Output 1) by using <?format-number:weight;'9G990D00'?>
    However, I can not get the Output2) as expected.
    If I put <?format-number:(weight)*0.8;'9G990D00'?>,
    I get the error message "Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert .55 kg to number."
    Appreciate any help on how to solution for Output2)
    Edited by: user4697912 on Jun 22, 2010 1:23 AM
    Edited by: user4697912 on Jun 22, 2010 1:23 AM

    If that is the case then try using
    <?format-number:( substring-before(WEIGHT,'kg')*0.8);'9G990D00'?>

Maybe you are looking for

  • Mpeg2 blueray gives me better quality that H.264 blueray

    When I use the set prests for H.264 - blueray that CS5 has in the media encoder the quality looks a little poor? But when I use the Mpeg2 -blueray option this gives me a quality identical to the orginal HDV footage. Everywhere I've read people say th

  • File Import Error

    Cannot import MPEG-2 files into AME. Error message reads "Error while decompressing the source file" Other formats seem to work OK

  • Material availibility in prod  order

    Dear all , For SFG production order RM required . In prodction order Storage location for this RM is 0001. where as in MMBE stock available for this RM at 0002. still prodn order status is MACM ? Pl guide where to check regards ,

  • Why isn't Calendar showing me directions in OSX Mavericks?

    I recently upgraded to Mavericks on my macbook pro. I wanted to use the new calendar feature that showed you the location and route to an appointment. However, when I add a location to the "add location" part of the calendar event, nothing happened,

  • Import Wizard not functioning in Developer Studio

    I am attempting to import a par file into Developer Studio in order to modify it. When I click File > Import, the dialog box "The following wizards are available" Select Import Source shows a blank list of no import sources and it seems there is no w