Need Help in Improving Performace of PLSQL Code

Hello Gurus,
I am very new to PL/SQL Coding. i had to design a code that takes values from 3 tables and fills the empty 4th table.
Table 1 : IDH(primary key),Table 2 :IDH(primary key) and Table 3 where IDH exists but not a Primary key(means has multiple values for each IDH)
So my approach was i created a STORED PROCEDURE as below
1. Create a cursor joining Table1 and Table 2
2. Iterate over the Cursor, for Each IDH create one more cursor over Table 3 and Calculate some values.
3. insert into the New Table.
But this seems to take a long time (more than 5 hours)
Can you please help me in optimizing this solutions ?
Thanks,
Ganesh

BRAND table : IDH,BRAND,SUBBRAND -> IDH Primary key
MARKET table : IDH,MARKET,VARIANT -> IDH Primary key
MAT table : col1,IDH,col4,col5,col15 -> no primary key here * redundant table
New table needs to be created as follows
LEGEND table : IDH,BRAND,SUBBRAND,MARKET,VARIANT,CODE,EAN
now its easy to get IDH,BRAND,SUBBRAND,MARKET,VARIANT into the LEGEND table (just a join result will give)
but CODE is calculated as follows
FOr an IDH in MAT
     if col4 contains 'OLDKEZ' then
          CODE:= col5;
EAN is calculated as follows
FOr an IDH in MAT
     if col1 contains 'MARA' then
          CODE:= col15;
this i am accomplishing by using 2 cursors (nested), which takes a long time !!!
Can you give any inputs ?

Similar Messages

  • Need help - Error: MDN is not found (code: 33)

    Whenever I open my Verizon Cloud it says "Error: MDN is not found (code: 33). I NEED HELP! This phone has to be sent back soon becuase I got a replacment. HELP HELP HELP
    I have a galaxy s3
    Subject line edited into post.
    Message was edited by: Admin Moderator

    Make sure both phones (iPhone, Moto X, Droid X, Samsung Galaxy, Nokia, Motorola) are connected to the same wifi .. on the new device you will first have to download and install the updates by going to Settings >> About Device >> Updates.  Once the updates have been installed you will not receive the error "MDN is not found (code: 33).  You can proceed to pair the devices and transfer your content. It will also give the option to select the type of content (contacts, photos, video) you want to transfer.
    Thanks www.strongpurpose.com for helping find this solution .. they made it easy for me to get my content transferred so I can get back to the important stuff .. Follow Your Passion!

  • Need help installing Adobe Pro 9 Product code [removed by moderator] to my new PC tower.

    Need help installing Adobe Pro 9 to my new PC.

    Hi albertc40027908,
    You might need to deactivate Acrobat 9 from your old machine.
    Then, install the software from a CD (if you have) and activate with the same serial number.
    If you don't have a CD, then you might install Acrobat 9 pro from the below mentioned link:
    Download Acrobat products | 9, 8
    Hope this helps.
    Regards,
    Anubha

  • Need help in improving the performance for the sql query

    Thanks in advance for helping me.
    I was trying to improve the performance of the below query. I tried the following methods used merge instead of update, used bulk collect / Forall update, used ordered hint, created a temp table and upadated the target table using the same. The methods which I used did not improve any performance. The data count which is updated in the target table is 2 million records and the target table has 15 million records.
    Any suggestions or solutions for improving performance are appreciated
    SQL query:
    update targettable tt
    set mnop = 'G',
    where ( x,y,z ) in
    select a.x, a.y,a.z
    from table1 a
    where (a.x, a.y,a.z) not in (
    select b.x,b.y,b.z
    from table2 b
    where 'O' = b.defg
    and mnop = 'P'
    and hijkl = 'UVW';

    987981 wrote:
    I was trying to improve the performance of the below query. I tried the following methods used merge instead of update, used bulk collect / Forall update, used ordered hint, created a temp table and upadated the target table using the same. The methods which I used did not improve any performance. And that meant what? Surely if you spend all that time and effort to try various approaches, it should mean something? Failures are as important teachers as successes. You need to learn from failures too. :-)
    The data count which is updated in the target table is 2 million records and the target table has 15 million records.Tables have rows btw, not records. Database people tend to get upset when rows are called records, as records exist in files and a database is not a mere collection of records and files.
    The failure to find a single faster method with the approaches you tried, points to that you do not know what the actual performance problem is. And without knowing the problem, you still went ahead, guns blazing.
    The very first step in dealing with any software engineering problem, is to identify the problem. Seeing the symptoms (slow performance) is still a long way from problem identification.
    Part of identifying the performance problem, is understanding the workload. Just what does the code task the database to do?
    From your comments, it needs to find 2 million rows from 15 million rows. Change these rows. And then write 2 million rows back to disk.
    That is not a small workload. Simple example. Let's say that the 2 million row find is 1ms/row and the 2 million row write is also 1ms/row. This means a 66 minute workload. Due to the number of rows, an increase in time/row either way, will potentially have 2 million fold impact.
    So where is the performance problem? Time spend finding the 2 million rows (where other tables need to be read, indexes used, etc)? Time spend writing the 2 million rows (where triggers and indexes need to be fired and maintained)? Both?

  • EP6 sp12 Performance Issue, Need help to improve performance

    We have a Portal development environment with EP6.0 sp12.
    What we are experiencing is performance issue, It's not extremely slow, but slow compared to normal ( compared to our prod box). For example, after putting the username and password and clicking the <Log on> Button it's taking more than 10 secs for the first home page to appear. Also currently we have hooked the Portal with 3 xAPPS system and one BW system. The time taken for a BW query to appear ( with selection screen) is also more than 10 secs. However access to one other xAPPS is comparatively faster.
    Do we have a simple to use guide( Not a very elaborate one) with step by step guidance to immediately improve the performance of the Portal.
    Simple guide, easy to implement,  with immediate effect is what we are looking for in the short term
    Thanks
    Arunabha

    Hi Eric,
      I have searched but didn't find the Portal Tuning and Optimization Guide as you have suggested, Can you help to find this.
    Subrato,
      This is good and I would obviously read through this, The issue here is this is only for Network.
      But do you know any other guide, which as very basic ( may be 10 steps) and show step by step the process, it would be very helpful. I already have some information from the thread Portal Performance - page loads slow, client cache reset/cleared too often
    But really looking for answer ( steps to do it quickly and effectively) instead of list of various guides.
    It would be very helpful if you or anybody( who has actually done some performance tuning) can send  a basic list of steps that I can do immediately, instead of reading through these large guides.
    I know I am looking for a shortcut, but this is the need of the hour.
    Thanks
    Arun

  • Need help.. can someone look at code..

    and tell me what is happening, or rather not happening and
    why....
    This is a neat clock that shows current time and zulu time
    with a disclaimer popup..... Would like to get it working to put on
    my site but can not figure it out.
    It is made up of two files.... first is the html file:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <script language-"javascript"
    src="clock.js"></script>
    <!-- InstanceParam name="onloadVal" type="text"
    value="doTime()" -->
    <title>Clock</title>
    </head>
    <body>
    <FORM name=Horloge>
    <TABLE cellSpacing=0 cellPadding=0 width=756
    bgColor=#205670>
    <TBODY>
    <TR>
    <TD height=34><FONT face="Arial, Helvetica,
    sans-serif" color=#ffffcc
    size=-2>Your time </FONT><font face="Arial,
    Helvetica, sans-serif"
    color=#ffffcc size=-1>
    <input value="Not available" name=HreLocale />
    </font></TD>
    <TD height=34><FONT face="Arial, Helvetica,
    sans-serif" color=#ffffcc
    size=-2>UTC time</FONT><font face="Arial,
    Helvetica, sans-serif"
    color=#ffffcc size=-1>
    <input value="Not available" name=HreUTC />
    </font></TD>
    <TD noWrap width=100 height=34>
    <DIV align=center><font color=#ffffcc size=-2>
    <input onclick="MM_popupMsg('Reliable clock times are
    dependant on two sources:\r1. Your computer`s time\r2. Your
    computer`s time zone settings\rPlease verify that both these
    settings are correct before relying on the clock.')" type=button
    value="Clock Disclaimer" name="Clock Disclaimer" />
    </font></DIV></TD>
    <TD noWrap width=67 colSpan=4 height=34>
    <DIV align=center><FONT face="Arial, Helvetica,
    sans-serif" color=#ffffcc
    size=-2></FONT></DIV>
    <DIV align=center><FONT size=+1><A
    href="javascript:seLogger()"><FONT
    face="Arial, Helvetica, sans-serif" color=#ffffcc
    size=-1>Log
    out</FONT></A></FONT></DIV></TD></TR></TBODY></TABLE>
    </form>
    </body>
    </html>
    Then there is a seperate .js file:
    function format(value) {
    if (value < 10) {
    return "0" + value;
    } else {
    return value;
    function putFocus() {
    // Put the cursor in the first text box available
    // or in the specified field with id="init"
    // Params: none
    var f = 0;
    var e = 0;
    var fName;
    if (document.getElementById &&
    document.getElementById('init')) {
    if (document.getElementById('init').type != "hidden") {
    document.getElementById('init').focus();
    } else while (f < document.forms.length &&
    document.forms[f].name != "Horloge") {
    e = 0;
    while (document.forms[f] && e <
    document.forms[f].elements.length) {
    if (document.forms[f].elements[e].type == "text"
    || document.forms[f].elements[e].type == "password") {
    document.forms[f].elements[e].focus();
    fName = document.forms[f].name;
    e=9999;f=9999;
    e++;
    f++;
    function enterAction(obj) {
    // Capture key events at the document level and submit the
    form when the enter key is pressed
    // by a simulated click on the submit button given as
    parameter.
    // Function added by Thierry Husson 2006-05
    // Sample call: <body
    onLoad="enterAction(document.Registered.elements['R-Submit']);">
    if (obj && obj.click) {
    if (document.layers) document.captureEvents(Event.KEYPRESS);
    document.onkeypress = function (evt) {
    var key = document.all ? event.keyCode : evt.which ?
    evt.which : evt.keyCode;
    if (key == 13) {
    obj.click();
    function doTime() {
    months = new Array(12);
    months[0] = "Jan";
    months[1] = "Feb";
    months[2] = "Mar";
    months[3] = "Apr";
    months[4] = "May";
    months[5] = "Jun";
    months[6] = "Jul";
    months[7] = "Aug";
    months[8] = "Sep";
    months[9] = "Oct";
    months[10] = "Nov";
    months[11] = "Dec";
    days = new Array(7);
    days[0] = "Sun";
    days[1] = "Mon";
    days[2] = "Tue";
    days[3] = "Wed";
    days[4] = "Thu";
    days[5] = "Fri";
    days[6] = "Sat";
    strLocalTime = "Your Time: ";
    strUTCTime = "UTC Time: ";
    local = new Date();
    tzOffset = local.getTimezoneOffset()/60;
    localMonth = local.getMonth();
    localDay = local.getDay();
    localDate = local.getDate();
    localYear = local.getYear();
    localHour = local.getHours();
    localMin = local.getMinutes();
    localSec = local.getSeconds();
    UTCDate = new Date(localYear, localMonth, localDate,
    localHour + (tzOffset/1), localMin + ((tzOffset%1)*60), localSec);
    if (localYear < 1900) {
    localYear = 1900 + localYear;
    UTCYear = localYear;
    strLocalTime = format(localDate) + " " + months[localMonth]
    + " " + format(localYear) + " " + localHour + ":" +
    format(localMin) + ":" + format(localSec);
    strUTCTime = format(UTCDate.getDate()) + " " +
    months[UTCDate.getMonth()] + " " + format(UTCYear) + " " +
    UTCDate.getHours() + ":" + format(UTCDate.getMinutes()) + ":" +
    format(UTCDate.getSeconds());
    document.Horloge.HreLocale.value = strLocalTime;
    document.Horloge.HreUTC.value = strUTCTime;
    setTimeout("doTime()", 1000);
    //==============================================================
    // Fonction doAsepTime est basee sur doTime mais modifiee
    pour ne recuperer
    // que les champs utiles soit : AAAA MM JJ HH UTC.
    // Fonction doAsepTime retourne dans :
    // input name="HreAsep value="YYYY MM DD HH" lorsque vide
    (anglais)
    // input name="HreAsep value="AAAA MM JJ HH" lorsque vide
    (francais)
    //==============================================================
    function doAsepTime() {
    // strUTCTime sera retourne a l 'interface (html)
    strUTCTime = "UTC Time: ";
    local = new Date();
    tzOffset = local.getTimezoneOffset()/60;
    AsepLocalMonth = local.getMonth();
    AsepLocalDate = local.getDate();
    AsepLocalYear = local.getYear();
    AsepLocalHour = local.getHours();
    UTCDate = new Date(AsepLocalYear, AsepLocalMonth,
    AsepLocalDate, AsepLocalHour + (tzOffset/1));
    if (AsepLocalYear < 1900) {
    AsepLocalYear = 1900 + AsepLocalYear;
    UTCYear = AsepLocalYear;
    strUTCTime = format(UTCYear) + " " +
    format(UTCDate.getMonth() + 1) + " " + format(UTCDate.getDate()) +
    " " + format(UTCDate.getHours());
    document.Produit.HreAsep.value = strUTCTime;
    // setTimeout("doAsepTime()", 1000);

    Hi. I'm new to Java myself, but I've noticed a few things in your code..you have a bunch of methods inside the braces of your main method, which cannot work. Additional methods must be placed outside the main method, after the ending brace. But actually, if this is a secondary class and these methods will be called from a different class, which it looks to me to be, then you wouldn't need a main method at all. The class variables should go right after the opening brace of the class declaration and then the rest of the methods can be placed after those variables. Try this..
    public class Date
         int day;
         int month;
         int year;
         public Date(int day, int month, int year)
              setDay(day);
              setMonth(month);
              setYear(year);
         public void setDay(int myDay)
              day =myDay;
         public void setMonth(int myMonth)
              month =myMonth;
         public void setYear(int myYear)
              year =myYear;
         public int getDay()
              return day;
         public int getMonth()
              return month;
         public int getYear()
              return year;
         public String displayDate()
              return getMonth() + "/" + getDay() + "/" + getYear();
    Sorry it that's hard to read, I just copied and pasted it, but all I did was eliminate the declaration of the main method, the opening brace, and the closing brace (second to last one at the bottom).
    Hope this helps..Take care.

  • I need help to improve speed

    Hello
    I have a JTable with 33 nessesary columns. The row count can be from 1 to 50. That gives maximum 1650 diffrent values to save to the database.
    The current system, creates a object for each line(33 values) and fill them into a arraylist, send it to my dao, who takes object by object and stores them. The speed this way is "okay, could be better".
    Then when im retreawing the data, I get row by row, create a object, fill my arraylist, goes trough it object by object and put them in each row.
    1 row goes fast, 5 rows takes time, 50 rows takes forever...
    What can speed things upp here ? If u need some code, please let me know.
    Ive been thinking of something thread based, 1 thread for each row, sounds smart?

    My JTable lists "meetings" for 1 week. 1 row presents a meetings data.
    There are 2 JButtons used for changing week, either +1 or -1 from the week number your standing inn. I will now show everything that happens with 1 click. Thats 4 steps.
    Step 1: Saving current data(meetings for current week)
         private void saveM�ter() {
              dao.slettM�ter(�r, uke);
              ArrayList m�ter = new ArrayList();
              for (int i = 0; i < mdlRapport.getRowCount(); i++) {
                   UkerapportM�te m�te =
                        new UkerapportM�te(
                             �r,
                             uke,
                             (String) mdlRapport.getValueAt(i, 0),
                             (String) mdlRapport.getValueAt(i, 1),
                             (String) mdlRapport.getValueAt(i, 32),
                             (String) mdlRapport.getValueAt(i, 33));
                   UkerapportM�te m�teX = formatM�te(m�te);
                   m�ter.add(m�teX);
              dao.lagreM�ter(m�ter);
         }Comments:
    dao.slettM�ter(�r, uke); This method removes everything from the database for the current week.
    dao.lagreM�ter(m�ter);This method saves everything to the database current week. That method is posted bellow, maybe that is a bottleneck.
         public void lagreM�ter(ArrayList m�ter) {
              Statement stmt = null;
              String sql = null;
              UkerapportM�te m�te = null;
              try {
                   for (int i = 0; i < m�ter.size(); i++) {
                        m�te = (UkerapportM�te) m�ter.get(i);
                        sql =      " INSERT INTO Ukerapport VALUES("
                                  + m�te.get�rID()
                                  + ","
                                  + m�te.getUkeID()
                                  + ",'"
                                  + m�te.getM�tedag()
                                  + "','"
                                  + m�te.getM�teKlokke()
                                  + "','"
                                  + m�te.getM�teSted()
                                  + "','"
                                  + m�te.getM�teKunde()
                        + "','"
                                  + m�te.getPrivatBilP()
                        + "','"
                                  + m�te.getPrivatBilS()
                        + "','"
                                  + m�te.getPrivatVillaP()
                        + "','"
                                  + m�te.getPrivatVillaS()
                        + "','"
                                  + m�te.getPrivatServP()
                        + "','"
                                  + m�te.getPrivatServS()
                        + "','"
                                  + m�te.getN�ringslivAntP()
                        + "','"
                                  + m�te.getN�ringslivAntS()
                        + "','"
                                  + m�te.getMersalgKrP()
                        + "','"
                                  + m�te.getMersalgKrS()
                        + "','"
                                  + m�te.getMersalgAntP()
                        + "','"     
                                  + m�te.getMersalgAntS()
                        + "','"
                                  + m�te.getLivP()
                        + "','"
                                  + m�te.getLivS()
                        + "','"
                                  + m�te.getSparAntP()
                        + "','"
                                  + m�te.getSparAntS()
                        + "','"
                                  + m�te.getSparKrP()
                        + "','"
                                  + m�te.getSparKrS()
                        + "','"
                                  + m�te.getKollpensjonAntP()
                        + "','"
                                  + m�te.getKollpensjonAntS()
                        + "','"
                                  + m�te.getKollpensjonKrP()
                        + "','"
                                  + m�te.getKollpensjonKrS()
                        + "','"
                                  + m�te.getFinansAntP()
                        + "','"
                                  + m�te.getFinansAntS()
                        + "','"
                                  + m�te.getFinansKrP()
                        + "','"
                                  + m�te.getFinansKrS()
                        + "','"
                                  + m�te.getRef()
                        + "','"
                                  + m�te.getProv()
                        + "','"
                                  + m�te.getForening()
                                  + "','"
                                  + m�te.getKommentar()
                                  + "')";
                        stmt = con.createStatement();
                        //rs = stmt.executeQuery(sql);
                        int x = stmt.executeUpdate(sql);
              } //end try
              catch (SQLException e) {
                   System.out.println("UkerapportDAO: Klarer ikke � utf�re sp�rringen: " + sql);
                   System.out.println("--lagreM�ter() " + e.getMessage() + "\n");
              }finally{
                   try{
                   if(stmt!=null)
                        stmt.close();
                   }catch(SQLException sqlex){
                        System.out.println("UkerapportDAO: Klarer ikke � lukke");
                        System.out.println("--lagreM�ter() " + sqlex.getMessage() + "\n");
         }Step 2:
    I update values for week and year, depening on going 1 week up or down. I dont find it nessesary to show that code....
    Step 3: Remove everything from the JTable
         private void clearTable() {
              for (int i = 0; i < mdlRapport.getRowCount(); i++) {
                   mdlRapport.removeRow(i);
         }Comments: Dont think theres anything todo here...
    Step4: Get new meetings from the database.
    private void loadM�ter() {
              ArrayList nyeM�ter = dao.getM�ter(�r, uke);
              mdlRapport.setRowCount(nyeM�ter.size());
              for (int i = 0; i < nyeM�ter.size(); i++) {
                   UkerapportM�te m�te = (UkerapportM�te) nyeM�ter.get(i);
                   if (m�te.getM�tedag().equals("Blank")) {
                        mdlRapport.setValueAt("", i, 0);
                   } else {
                        mdlRapport.setValueAt(m�te.getM�tedag(), i, 0);
                   if (m�te.getM�teKlokke().equals("Blank")) {
                        mdlRapport.setValueAt("", i, 1);
                   } else {
                        mdlRapport.setValueAt(m�te.getM�teKlokke(), i, 1);
                   if (m�te.getProv().equals("0")) {
                        mdlRapport.setValueAt("", i, 31);
                   } else {
                        mdlRapport.setValueAt(m�te.getProv() + "", i, 31);
                   if (m�te.getForening().equals("Blank")) {
                        mdlRapport.setValueAt("", i, 32);
                   } else {
                        mdlRapport.setValueAt(m�te.getForening(), i, 32);
                   if (m�te.getKommentar().equals("Blank")) {
                        mdlRapport.setValueAt("", i, 33);
                   } else {
                        mdlRapport.setValueAt(m�te.getKommentar(), i, 33);
         }Comments: I skipped alot of code here, This code is ofcouse much longer, I just took the first if*s and the last ones.
    ArrayList nyeM�ter = dao.getM�ter(�r, uke); This method is posted bellow.
         public ArrayList getM�ter(int �rID, int ukeID) {
              Statement stmt = null;
              ResultSet rs = null;
              String sql = "SELECT * FROM Ukerapport WHERE ukeID="      + ukeID      + " AND �rID =" + �rID;
              list = new ArrayList();
              try {
                   stmt = con.createStatement();
                   rs = stmt.executeQuery(sql);
                   while (rs.next()) {
                        m�te =
                             new UkerapportM�te( rs.getInt(1), rs.getInt(2), rs.getString(3), rs.getString(4), rs.getString(5), rs.getString(6), rs.getString(7), rs.getString(8), rs.getString(9), rs.getString(10), rs.getString(11), rs.getString(12), rs.getString(13),      rs.getString(14), rs.getString(15), rs.getString(16),      rs.getString(17), rs.getString(18), rs.getString(19), rs.getString(20),      rs.getString(21),      rs.getString(22),      rs.getString(23), rs.getString(24), rs.getString(25), rs.getString(26),      rs.getString(27),      rs.getString(28), rs.getString(29), rs.getString(30), rs.getString(31), rs.getString(32), rs.getString(33), rs.getString(34), rs.getString(35),      rs.getString(36));
                        list.add(m�te);
                   rs.close();
                   stmt.close();
              } catch (SQLException sqlex) {
                   System.out.println( "Error: Klarer ikke � utf�re sp�rringen. " + sqlex.getMessage());
                   System.out.println( "--getM�ter()");
              return list;
         }I Think this is the slow part. The if tests where made cause i had trouble saving empty meeting values in the database, so When a meetings value is missing i save it as "Blank", and when i read the data i check for "Blank" and if true I set the value "".
    Can you help me make this faster?

  • !! Need help !! 5800 XM Lock code problem !!

    hello all ,
    Month ago i bought Nokia 5800Xm , next day of buying i find out problems with my handset , first of all all of my data in the memory card gets automatically deleted " don't know the reason " after that everytime when i click on messages it says cannot access memory card phone memory will be used. The main problem was that when the phone is locked then each time when i cancel the it " means cancel the lock code " there was a square dot in b/w 4 and 7 , next day i was at Nokia care and gave ma handset for check n all , they 1 of all said that it is a software issue , suddenly they say that it is a screen problem and the handset screen will be replaced . I was shocked when i hear this  , they say aftere 15 days it will be replaced , i gave ma handset to them , after 15 days yesterday they gave me ma handset . The black dot problem was solved but now whenver i cancel the lockcode , the background where lock is present sometime the screen get full black , sometime half black screen and half lock is shown , sometime full lock is shown, i again went to Nokia care they say it is the newly firmware problem " don't know if there were lying or something " . My Nokia 5800XM ver. is v31.0.008
    Plz tell me is there any other problem ?? I buyed it from Nokia , so i shout them that if there is another problem in ma handset , i need a new Nokia 5800 XM .
    Thanks
    Marshal

    What country are you in? Phones for certain countries where GPS on phones is outlawed (China I think is one) have no GPS built in, or functionality removed.
    If you find my post helpful please click the green star on the left under the avatar. Thanks.

  • Need help returning correct name from a code created movie clip

    Hello. I am an AS3 n00b with hopefuly a simple question I am designing a simple game in flash. This code creates an array of movie clips and asigns a picture to each one. It is a map screen. What I need is when I click on one of the created movie clips, I need it to return either the index of the clip in the array or the name of the clip. Basicaly anything I can use to tell them apart in the code. Here is the code:
    import flash.display.MovieClip;
    var MapLoader:Array = new Array();
    var strJPGext:String = ".jpg";
    var intContTileNumber:int;
    var strContTilePath:String;
    var intDistStartX:int = 63;
    var intDistStartY:int = 64;
    var intDistMultiplyY:int = 0;
    var intDistMultiplyX:int = 0;
    var intDistCount:int = 0;
    var MapSquare:Array = new Array();
    for (var i:int = 0; i < 729; i++)
             //var MapSquare:MovieClip = new MovieClip();
            MapSquare.push (new MovieClip());
            MapSquare[i].x = intDistStartX + (intDistMultiplyX * 30);
            MapSquare[i].y = intDistStartY + (intDistMultiplyY * 30);
            MapSquare[i].name = "MapSquare" + i ;
            addChild(MapSquare[i]);
            intContTileNumber = i;
            MapLoader.push (new Loader);
            strContTilePath = intContTileNumber + strJPGext;
            MapLoader[i].load(new URLRequest(strContTilePath));
            MapSquare[i].addChild(MapLoader[i]);
            intDistCount++;
            intDistMultiplyX++;
            if (intDistCount > 26){
            intDistCount = 0;
            intDistMultiplyX = 0;
            intDistMultiplyY++;
    stage.addEventListener(MouseEvent.CLICK, reportClick);
    function reportClick(event:MouseEvent):void
        trace("movieClip Instance Name = " + event.target.name);   
    Now all this works fine, it creates the map and assigns the correct picture and places them in the correct X,Y position and it is the correct grid of 27x27 squares. The problem is with the name, when I click on the movie clip, it returns "Instance2" or "Instance5" or whatever. It starts with 2 and then increases each number by 3 for each clip, so the first one is 2, then 5 then 8 and so on. This is no good. I need it to return the name that I assigned it
    . If I put the code in trace(MapSquare[1]) it will return the name "MapSquare1" so I know the name was assigned, but it isnt returning.
    Please assist
    Thanks,
    -red

    Thanks for the resopnse,
    I know I dont really need the name, I just need the index number of the array, but I cant figure out how to get the index name without specificaly coding for it. That is why in the listener event I use event.target.name because I dont know what movie clip is being clicked until it has been clicked on. Basically when a movie clip is clicked it needs to return which index of the array was clicked.
    I could do it this way:
    MapSquare[0].addEventListener(
      MouseEvent.MOUSE_UP,
      function(evt:MouseEvent):void {
        trace("I've been clicked!");
    MapSquare[1].addEventListener(
       MouseEvent.MOUSE_UP,
       function(evt:MouseEvent):void {
         trace("I've been clicked!");
    MapSquare[2].addEventListener(
       MouseEvent.MOUSE_UP,
       function(evt:MouseEvent):void {
         trace("I've been clicked!");
    ... ect
    but that is unreasonable and it kind of defeats the purpose of having the array in the first place. The code that each movie clip executes is the same, eventualy that index will be passed into a database and the data at that primary key will be retrieved and returned to the program. So I just need to know, when one of those buttons is clicked, which one was clicked and what is its index in the array.
    I am a VB programer and in VB this is very easy, the control array automatically sends its own index into the function when one of the buttons is clicked. It seems simple enough, I just dont know how to do it in action script.
    Thanks again,
    -red

  • Need help in writing a small java code

    Hi,
    I have a small requirement where I need write a small java code. I am thinking of using array. Please suggest if you know the solution:
    1. Need to compare user logon id is preset in the lookup table or not.
    2. If user id present in the lookup then send type "A" mail
    3. If user id in not present in the lookup then send type "B" email.
    Please suggest.
    Thanks,
    Kalpana.

    use this code . you have to pass userlogin and lookup name
    Public String GetEmail(String UserLogin,String lookupcode)
    String email;
    try{
    tcLookupOperationIntf lookupIntf = Platform.getService(tcLookupOperationIntf.class);
    HashMap<String, String> lookupValues = getLookupHashMap(lookupIntf, lookupCode);
    String found = lookupValues.get(UserLogin);
    if (found!=null) email= "EMAIL A";
    else
    email= "EMAIL B";
    }catch(Exception e){}
    return email;
    private HashMap<String, String> getLookupHashMap(tcLookupOperationsIntf lookupOperationsIntf, String lookupCode)throws tcAPIException,tcInvalidLookupException,tcColumnNotFoundException {
    HashMap<String, String> lookupMap = new HashMap<String, String>();
              tcResultSet resultLookupHashMap = lookupOperationsIntf
                        .getLookupValues(lookupCode);
              int countResultLookupHashMap = resultLookupHashMap.getRowCount();
    if (countResultLookupHashMap > 0) {
                   for (int i = 0; i < countResultLookupHashMap; i++) {
                        resultLookupHashMap.goToRow(i);
                        lookupMap.put(resultLookupHashMap..getStringValue("Lookup Definition.Lookup Code Information.Code Key"),
    resultLookupHashMap.getStringValue("Lookup Definition.Lookup Code Information.Decode"));
    return lookupMap;
    }

  • I need Help what is wrong with my code?

    Hi, well I am doing a class and a driver for a sphere. I need to compute the volume and surface area of the sphere I have the formula but when I run the program I don't get a result for neither. I would like to know what am I doing wrong? Here is my code. Thanks.
    This is my class
    import java.text.DecimalFormat;
        public class Sphere
       //Variable Declarations.
          private int diameter;
          private double radius;
       //Constructor: Accepts and initialize instance data.
           public Sphere(int sp_diameter)
             diameter = sp_diameter;
       //Set methods: Diameter
           public void setDiameter(int new_diameter)
             diameter = new_diameter;
       //Get methods: Diameter
           public int getDiameter()
             return diameter;
       //Compute volume and surface area of the sphere
           public double getVolume()
             return  4 * Math.PI * radius * radius * radius / 3;
           public double getArea()
             return  4 * Math.PI * radius * radius;
       //toString method will return one line description of the sphere
           public String toString()
             DecimalFormat fmt =new DecimalFormat("0.###");
             String sphere = " " + fmt.format(diameter) +fmt.format(getVolume()) + fmt.format(getArea());        
             return sphere;
    Here is the driver
    public static void main(String[]args)
             Sphere sphere1, sphere2, sphere3;
             sphere1 = new Sphere(10);
             sphere2 = new Sphere(12);
             sphere3 = new Sphere(20);
             System.out.println("The sphere diameter are: ");
             System.out.println("\tFirst Sphere diameter is: " + sphere1);
             System.out.println("\tSecond Sphere diameter is: " + sphere2);
             System.out.println("\tThird Sphere diameter is: " + sphere3);
          //Prints the Sphere Volume and  Surface Area.
             System.out.println("\nTheir Volume and Surface Area: ");
             System.out.println("\tSphere1: " + " " + sphere1.getVolume() + " " + sphere1.getArea());
             System.out.println("\tSphere2: " + " " + sphere2.getVolume() + " " + sphere2.getArea());
             System.out.println("\tSphere3: " + " " + sphere3.getVolume() + " " + sphere3.getArea());
          //Change the diameter of the sphere.
             sphere1.setDiameter(11);
             sphere2.setDiameter(15);
             sphere3.setDiameter(25);
             System.out.println("\nNew diameter is: ");
             System.out.println("\tFirst Sphere diameter is: " + sphere1);
             System.out.println("\tSecond Sphere diameter is: " + sphere2);
             System.out.println("\tThird Sphere diameter is: " + sphere3);
          //Prints the Sphere Volume and  Surface Area.
             System.out.println("\nTheir Volume and Surface Area: ");
             System.out.println("\tSphere1: " + " " + sphere1.getVolume() + " " + sphere1.getArea());
             System.out.println("\tSphere2: " + " " + sphere2.getVolume() + " " + sphere2.getArea());
             System.out.println("\tSphere3: " + " " + sphere3.getVolume() + " " + sphere3.getArea());
          //Using the toString Method.
             System.out.println("\nFirst sphere: " + sphere1);
       }

    Maybe try a different constructor for sphere...
    public Sphere(int sp_diameter, int sp_radius)
    diameter = sp_diameter;
    }nd maybe even a setRadius(int newRadius) and
    getRadius().
    Hope that helpsYou should not do it this way. The reason.. The radius is 1/2 the diameter. if you have seperate methods, then the programmer can set the diameter to X and the radius to 10X. not good.
    A better way for the c'tor would be:
        //Constructor: Accepts and initialize instance data.
        public Sphere(int sp_diameter) {
            diameter = sp_diameter;
            radius = (double) diameter/2.0;  //<-- I added this
        }something similar in the setDiameter..

  • Need help in improving performance of prorating quantities to stores for existing orders

    I have a code written to allocate quantities to stores for an existing order. Suppose there is a supplier order with quantity of 100 and this needs to distributed among 4 stores which has a demand of 50,40,30 and 20. Since total demand not equal to available quantity. the available quantity needs to be allocated to stores using an algorithm.
    ALgorithm is like allocating the stores in small pieces of innersize. Innersize is nothing but
    quantity within the pack of packs i.e. pack has 4 pieces and each pieces internally has 10 pieces,
    this 10 is called innersize.
    While allocating, each store is provided quantities of innersize first and this looping continues
    until available quantity is over
    Ex:
    store1=10
    store2=10
    store3=10
    store4=10
    second time:
    store1=10(old)+10
    store2=10(old)+10
    store3=10(old)+10
    store4=10(old)+10--demand fulfilled
    third time
    store1=20(old)+10
    store2=20(old)+10
    -- available quantity is over and hence stopped.
    My code below-
    =================================================
    int prorate_allocation()
      char *function = "prorate_allocation";
      long t_cnt_st;
      int t_innersize;
      int   t_qty_ordered;
      int t_cnt_lp;
      bool t_complete;
      sql_cursor alloc_cursor;
      EXEC SQL DECLARE c_order CURSOR FOR -- cursor to get orders, item in that, inner size and available qty.
      SELECT oh.order_no,
      ol.item,
      isc.inner_pack_size,
      ol.qty_ordered
      FROM ABRL_ALC_CHG_TEMP_ORDHEAD oh,
      ordloc ol,
      item_supp_country isc
      WHERE oh.order_no=ol.order_no
      AND oh.supplier=isc.supplier
      and ol.item=isc.item
      AND     EXISTS (SELECT 1 FROM abrl_alc_chg_details aacd WHERE oh.order_no=aacd.order_no)
            AND     ol.qty_ordered>0;
      char   v_order_no[10];
      char v_item[25];
      double v_innersize;
      char   v_qty_ordered[12];
      char v_alloc_no[11];
      char v_location[10];
      char v_qty_allocated[12];
      int *store_quantities;
      bool *store_processed_flag;
      EXEC SQL OPEN c_order;
      if (SQL_ERROR_FOUND)
      sprintf(err_data,"CURSOR OPEN: cursor=c_order");
      strcpy(table,"ORDHEAD, ORDLOC, ITEM_SUPP_COUNTRY");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
      EXEC SQL ALLOCATE :alloc_cursor;
      while(1)
      EXEC SQL FETCH c_order INTO :v_order_no,
      :v_item,
      :v_innersize,
      :v_qty_ordered;
      if (SQL_ERROR_FOUND)
      sprintf(err_data,"CURSOR FETCH: cursor=c_order");
      strcpy(table,"ORDHEAD, ORDLOC, ITEM_SUPP_COUNTRY");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
      if (NO_DATA_FOUND) break;
      t_qty_ordered     =atoi(v_qty_ordered);
      t_innersize =(int)v_innersize;
      t_cnt_lp         = t_qty_ordered/t_innersize;
      t_complete =FALSE;
      EXEC SQL SELECT COUNT(*) INTO :t_cnt_st
      FROM abrl_alc_chg_ad ad,
      alloc_header ah
      WHERE ah.alloc_no=ad.alloc_no
      AND   ah.order_no=:v_order_no
      AND   ah.item=:v_item
      AND   ad.qty_allocated!=0;
      if SQL_ERROR_FOUND
                sprintf(err_data,"SELECT: ALLOC_DETAIL, count = %s\n",t_cnt_st);
                strcpy(table,"ALLOC_DETAIL");
                WRITE_ERROR(SQLCODE,function,table,err_data);
                return(-1);
      if (t_cnt_st>0)
      store_quantities=(int *) calloc(t_cnt_st,sizeof(int));
      store_processed_flag=(bool *) calloc(t_cnt_st,sizeof(bool));
      EXEC SQL EXECUTE
      BEGIN
      OPEN :alloc_cursor FOR SELECT ad.alloc_no,
      ad.to_loc,
      ad.qty_allocated
      FROM    alloc_header ah,
      abrl_alc_chg_ad ad
      WHERE   ah.alloc_no=ad.alloc_no
      AND     ah.item=:v_item
      AND     ah.order_no=:v_order_no
      order by ad.qty_allocated desc;
      END;
      END-EXEC;
      while (t_cnt_lp>0)
      EXEC SQL WHENEVER NOT FOUND DO break;
      for(int i=0;i<t_cnt_st;i++)
      EXEC SQL FETCH :alloc_cursor INTO :v_alloc_no,
      :v_location,
      :v_qty_allocated;
      if (store_quantities[i]!=(int)v_qty_allocated)
      store_quantities[i]=store_quantities[i]+t_innersize;
      t_cnt_lp--;
      if (t_cnt_lp==0)
      EXEC SQL CLOSE :alloc_cursor;
      break;
      else
      if(store_processed_flag[i]==FALSE)
      store_processed_flag[i]=TRUE;
      t_cnt_st--;
      if (t_cnt_st==0)
      t_complete=TRUE;
      break;
      if (t_complete==TRUE && t_cnt_lp!=0)
      for (int i=0;i<t_cnt_st;i++)
      store_quantities[i]=store_quantities[i]+v_innersize;
      t_cnt_lp--;
      if (t_cnt_lp==0)
      EXEC SQL CLOSE :alloc_cursor;
      break;
      }/*END OF WHILE*/
      EXEC SQL EXECUTE
      BEGIN
      OPEN :alloc_cursor FOR SELECT ad.alloc_no,
      ad.to_loc,
      ad.qty_allocated
      FROM    alloc_header ah,
      abrl_alc_chg_ad ad
      WHERE   ah.alloc_no=ad.alloc_no
      AND     ah.item=:v_item
      AND     ah.order_no=:v_order_no
      order by ad.qty_allocated desc;
      END;
      END-EXEC;
      EXEC SQL WHENEVER NOT FOUND DO break;
      for (int i=0;i<t_cnt_st;i++)
      EXEC SQL FETCH :alloc_cursor INTO :v_alloc_no,
      :v_location,
      :v_qty_allocated;
      EXEC SQL UPDATE abrl_alc_chg_ad
      SET qty_allocated=:store_quantities[i]
      WHERE to_loc=:v_location
      AND   alloc_no=:v_alloc_no;
      if SQL_ERROR_FOUND
      sprintf(err_data,"UPDATE: ALLOC_DETAIL, location = %s , alloc_no =%s\n", v_location,v_alloc_no);
      strcpy(table,"ALLOC_DETAIL");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
      EXEC SQL UPDATE ABRL_ALC_CHG_DETAILS
      SET PROCESSED='Y'
      WHERE LOCATION=:v_location
      AND   alloc_no=:v_alloc_no
      AND PROCESSED IN ('E','U');
      if SQL_ERROR_FOUND
      sprintf(err_data,"UPDATE: ABRL_ALC_CHG_DETAILS, location = %s , alloc_no =%s\n", v_location,v_alloc_no);
      strcpy(table,"ABRL_ALC_CHG_DETAILS");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
      EXEC SQL COMMIT;
      EXEC SQL CLOSE :alloc_cursor;
      free(store_quantities);
      free(store_processed_flag);
      }/*END OF IF*/
      }/*END OF OUTER WHILE LOOP*/
      EXEC SQL CLOSE c_order;
      if SQL_ERROR_FOUND
      sprintf(err_data,"CURSOR CLOSE: cursor = c_order");
      strcpy(table,"ORDHEAD, ORDLOC, ITEM_SUPP_COUNTRY");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
    return(0);
    } /* end prorate_allocation*/

    I have a code written to allocate quantities to stores for an existing order. Suppose there is a supplier order with quantity of 100 and this needs to distributed among 4 stores which has a demand of 50,40,30 and 20. Since total demand not equal to available quantity. the available quantity needs to be allocated to stores using an algorithm.
    ALgorithm is like allocating the stores in small pieces of innersize. Innersize is nothing but
    quantity within the pack of packs i.e. pack has 4 pieces and each pieces internally has 10 pieces,
    this 10 is called innersize.
    While allocating, each store is provided quantities of innersize first and this looping continues
    until available quantity is over
    Ex:
    store1=10
    store2=10
    store3=10
    store4=10
    second time:
    store1=10(old)+10
    store2=10(old)+10
    store3=10(old)+10
    store4=10(old)+10--demand fulfilled
    third time
    store1=20(old)+10
    store2=20(old)+10
    -- available quantity is over and hence stopped.
    My code below-
    =================================================
    int prorate_allocation()
      char *function = "prorate_allocation";
      long t_cnt_st;
      int t_innersize;
      int   t_qty_ordered;
      int t_cnt_lp;
      bool t_complete;
      sql_cursor alloc_cursor;
      EXEC SQL DECLARE c_order CURSOR FOR -- cursor to get orders, item in that, inner size and available qty.
      SELECT oh.order_no,
      ol.item,
      isc.inner_pack_size,
      ol.qty_ordered
      FROM ABRL_ALC_CHG_TEMP_ORDHEAD oh,
      ordloc ol,
      item_supp_country isc
      WHERE oh.order_no=ol.order_no
      AND oh.supplier=isc.supplier
      and ol.item=isc.item
      AND     EXISTS (SELECT 1 FROM abrl_alc_chg_details aacd WHERE oh.order_no=aacd.order_no)
            AND     ol.qty_ordered>0;
      char   v_order_no[10];
      char v_item[25];
      double v_innersize;
      char   v_qty_ordered[12];
      char v_alloc_no[11];
      char v_location[10];
      char v_qty_allocated[12];
      int *store_quantities;
      bool *store_processed_flag;
      EXEC SQL OPEN c_order;
      if (SQL_ERROR_FOUND)
      sprintf(err_data,"CURSOR OPEN: cursor=c_order");
      strcpy(table,"ORDHEAD, ORDLOC, ITEM_SUPP_COUNTRY");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
      EXEC SQL ALLOCATE :alloc_cursor;
      while(1)
      EXEC SQL FETCH c_order INTO :v_order_no,
      :v_item,
      :v_innersize,
      :v_qty_ordered;
      if (SQL_ERROR_FOUND)
      sprintf(err_data,"CURSOR FETCH: cursor=c_order");
      strcpy(table,"ORDHEAD, ORDLOC, ITEM_SUPP_COUNTRY");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
      if (NO_DATA_FOUND) break;
      t_qty_ordered     =atoi(v_qty_ordered);
      t_innersize =(int)v_innersize;
      t_cnt_lp         = t_qty_ordered/t_innersize;
      t_complete =FALSE;
      EXEC SQL SELECT COUNT(*) INTO :t_cnt_st
      FROM abrl_alc_chg_ad ad,
      alloc_header ah
      WHERE ah.alloc_no=ad.alloc_no
      AND   ah.order_no=:v_order_no
      AND   ah.item=:v_item
      AND   ad.qty_allocated!=0;
      if SQL_ERROR_FOUND
                sprintf(err_data,"SELECT: ALLOC_DETAIL, count = %s\n",t_cnt_st);
                strcpy(table,"ALLOC_DETAIL");
                WRITE_ERROR(SQLCODE,function,table,err_data);
                return(-1);
      if (t_cnt_st>0)
      store_quantities=(int *) calloc(t_cnt_st,sizeof(int));
      store_processed_flag=(bool *) calloc(t_cnt_st,sizeof(bool));
      EXEC SQL EXECUTE
      BEGIN
      OPEN :alloc_cursor FOR SELECT ad.alloc_no,
      ad.to_loc,
      ad.qty_allocated
      FROM    alloc_header ah,
      abrl_alc_chg_ad ad
      WHERE   ah.alloc_no=ad.alloc_no
      AND     ah.item=:v_item
      AND     ah.order_no=:v_order_no
      order by ad.qty_allocated desc;
      END;
      END-EXEC;
      while (t_cnt_lp>0)
      EXEC SQL WHENEVER NOT FOUND DO break;
      for(int i=0;i<t_cnt_st;i++)
      EXEC SQL FETCH :alloc_cursor INTO :v_alloc_no,
      :v_location,
      :v_qty_allocated;
      if (store_quantities[i]!=(int)v_qty_allocated)
      store_quantities[i]=store_quantities[i]+t_innersize;
      t_cnt_lp--;
      if (t_cnt_lp==0)
      EXEC SQL CLOSE :alloc_cursor;
      break;
      else
      if(store_processed_flag[i]==FALSE)
      store_processed_flag[i]=TRUE;
      t_cnt_st--;
      if (t_cnt_st==0)
      t_complete=TRUE;
      break;
      if (t_complete==TRUE && t_cnt_lp!=0)
      for (int i=0;i<t_cnt_st;i++)
      store_quantities[i]=store_quantities[i]+v_innersize;
      t_cnt_lp--;
      if (t_cnt_lp==0)
      EXEC SQL CLOSE :alloc_cursor;
      break;
      }/*END OF WHILE*/
      EXEC SQL EXECUTE
      BEGIN
      OPEN :alloc_cursor FOR SELECT ad.alloc_no,
      ad.to_loc,
      ad.qty_allocated
      FROM    alloc_header ah,
      abrl_alc_chg_ad ad
      WHERE   ah.alloc_no=ad.alloc_no
      AND     ah.item=:v_item
      AND     ah.order_no=:v_order_no
      order by ad.qty_allocated desc;
      END;
      END-EXEC;
      EXEC SQL WHENEVER NOT FOUND DO break;
      for (int i=0;i<t_cnt_st;i++)
      EXEC SQL FETCH :alloc_cursor INTO :v_alloc_no,
      :v_location,
      :v_qty_allocated;
      EXEC SQL UPDATE abrl_alc_chg_ad
      SET qty_allocated=:store_quantities[i]
      WHERE to_loc=:v_location
      AND   alloc_no=:v_alloc_no;
      if SQL_ERROR_FOUND
      sprintf(err_data,"UPDATE: ALLOC_DETAIL, location = %s , alloc_no =%s\n", v_location,v_alloc_no);
      strcpy(table,"ALLOC_DETAIL");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
      EXEC SQL UPDATE ABRL_ALC_CHG_DETAILS
      SET PROCESSED='Y'
      WHERE LOCATION=:v_location
      AND   alloc_no=:v_alloc_no
      AND PROCESSED IN ('E','U');
      if SQL_ERROR_FOUND
      sprintf(err_data,"UPDATE: ABRL_ALC_CHG_DETAILS, location = %s , alloc_no =%s\n", v_location,v_alloc_no);
      strcpy(table,"ABRL_ALC_CHG_DETAILS");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
      EXEC SQL COMMIT;
      EXEC SQL CLOSE :alloc_cursor;
      free(store_quantities);
      free(store_processed_flag);
      }/*END OF IF*/
      }/*END OF OUTER WHILE LOOP*/
      EXEC SQL CLOSE c_order;
      if SQL_ERROR_FOUND
      sprintf(err_data,"CURSOR CLOSE: cursor = c_order");
      strcpy(table,"ORDHEAD, ORDLOC, ITEM_SUPP_COUNTRY");
      WRITE_ERROR(SQLCODE,function,table,err_data);
      return(-1);
    return(0);
    } /* end prorate_allocation*/

  • Need Help in improving logic for determining the range

    Hi guys,
    I need some help in my program logic to determine the range of value. My purpose of this program is to find which combinations have the lowest amplitude.
    In the attachment is a set of number.
    e.g 10    0 is a combination.
    Each combination, I will need to draw a graph of data acquired using this combination VS gray level. There is 255 gray level. Every 5 gray level I will acquire a point so I will have 52 points.
    Next, I will get the maximum value - minimum value. And this is the amplitude for the combination. I can do all this function, however it is not practical for me to do it this way until 360 360. There is a round 1200+ combination. It requires a long time since I need to interface all this function with my hardware.
    The graph of each combination maybe a irregular shape. Do any of you have a logic to help me to shorten the process and find the range of values (combination) where the lowest amplitude may lies. Thanks!!
    Attachments:
    example.txt ‏11 KB

    Hi Johnsold,
    This is a example of my result. This is only a portion of it. The last column is the amplitude, I store all the 52 points into array and used Array Min and Max function. Then I use max - min to get the amplitude. From the amplitude I cannot see any pattern. Can you please advice me on it. Thanks!!!

  • Need help getting scrollbar from design to code

    First off id like to say I'm VERY NEW to coding I know the basics of CSS and I even less of flash. But im willing to learn anything iv only been doing this for 3 months.
    i have CS5 master colection
    ok Here is my design for the cliant's site
    the part im having trouble with is the gallery on the left.
    i sent the the scrollbar to flash Catalyst CS5. but then i could not find out how to make my custom scrollbar work in dreamweaver so i sent the whole gallery. then i ran in to the problem of
    how do i make the gallery control which embedded youtube video is going to play.
    i would like to just do it with out making the whole gallery a swf file.
    so in the most simplest terms i would like a custom designed scrollbar on the left side of my gallery div
    here is what i have uploaded to my test file on the back end of the quick version of his site http://http://resettheus.com/Test/Big_Gov.html
    plz help even if you could just point me to a tutorial that would be great.
    thank you

    thank you for the help JTANNA let me try to be a little more clear (this is y i never post on these things i never say the right thing)
    this is what i would like the site gallery to look like
    the scrollbar (B) is one of those black papper clips and the gallery (A)is just going to be thumbnails linked to a iframe that will be youtube videos
    so i re worked the CSS code from what i posted earlier to somthing like this (im not on my work comp with the sntax at hand)
    <div class=player_gallery>
         <div class=gallery_header>Video Galler</div>
         <div style="width:24px; height:415px;">   was hoping to put the scrollbar (B) here    </div>
         <div style="width:226px: height:auto;">
                   <a href="http://www.youtube.com/embed/o5gEceNyp0M" target="player">
                   <img src="Images/Markets-Exploitation-or-Empowerment.jpg" width="82px" height="50px"/>
                   <p>Markets Exploitation or Empowerment</p></a>
                        </div>
    something like that. i know that i have things wrong in there but i hope from this post and my last post i can get the answer im looking for
    thanks again

  • Hi there, I new with AE script (I much familiar with ActionScript in Flash, not an expert though). I try to control my solid object using GUI Slider I made but it's doesn't work. I need help here. Here is my code:

    myComp = app.project.item(1);
    mySolid = myComp.layers.addSolid([1.0,1.0,0], "my square", 50, 50, 1);
    var myWin = new Window("palette", "Transform", undefined);
        myWin.orientation = "row";
    var myOpacity = myWin.add("panel", undefined, "Opacity");
        myOpacity.orientation = "column";
        myOpacityText = myOpacity.add("statictext", [290, 20, 380, 40], "Current value:");
        myOpacityDisplay = myOpacity.add("statictext", [385, 20, 425, 40], "100");
        myOpacity.add("statictext", undefined, "Kontrol Opacity");
        theOpacity = myOpacity.add("slider", [20, 20, 230, 45], 50, 0, 100);
        var layerOpacity = mySolid.property("opacity");
        theOpacity.onChanging = function()
             var val = Math.round(theOpacity.value);
      myOpacityDisplay.text = val;
             layerOpacity.value = val;
    myWin.center();
    myWin.show();

    I don't write scripts that do this because the features are already available with Expression Controls and expressions. That's the route I would suggest. You are reinventing the wheel. If you want specific help on scripting then try asking some questions in the scripting sub forum for AE. You'll find the forum under sub communities.
    If you just want to create a slider for opacity that you can add to any layer you select first add an expression control slider to the layer, then press t to reveal the opacity property, then hold down the Alt/Option key and click on the stopwatch to start and expression, then drag the pickwhip to the slider control. Now, with transparency selected select Animation>Save Animation Preset and give it a name. Now when you need a slider to control a layer, or to control a bunch of layers simply select them and apply your preset.
    You could also put your expression control slider on a null, give the name a null, apply the expression to a layer and then save the transparency property as an animation preset. Now if you have 50 layers you want to control with a single slider just add the null, change the name, then select all 50 layers and apply your animation preset.
    I have a library of about 200 custom animation presets that use expressions to do most of my repetitive  tasks. It saves a ton of time. Heres one that fades a layer in and then out based on the in and out point of the layer. I use this one daily. You'll see what I mean if you apply it to a layer. fadeIO.ffx

Maybe you are looking for