Faster way of doing this?

Is there a faster way to do either of these and accomplish the same result?
     public int getXPForLevel(int level) {
          int points = 0;
          int output = 0;
          for (int lvl = 1; lvl <= level; lvl++) {
               points += Math.floor((double)lvl + 300.0 * Math.pow(2.0, (double)lvl / 7.0));
               if (lvl >= level)
                    return output;
               output = (int)Math.floor(points / 4);
          return 0;
     public int getLevelForXP(int exp) {
          int points = 0;
          int output = 0;
          for (int lvl = 1; lvl <= 99; lvl++) {
               points += Math.floor((double)lvl + 300.0 * Math.pow(2.0, (double)lvl / 7.0));
               output = (int)Math.floor(points / 4);
               if (output >= exp)
                    return lvl;
          return 0;
     }

You ask for a way to make things faster, and people respond by saying, "why do you want it faster?", or "Are you sure you want it fast? I think your making a mistake by trying to make it faster." Amazing. If you need this fast, you should definitely construct a lookup table and use that for both functions. I haven't verfied your calculator function, but assuming it's right this should work for you. The getLevelForXP is still using a linear search, but it should be much much faster than what your using now. If you need that even faster, you could use a binary search, starting at MAX_LEVEL / 2 to determine whether your target is above or below that level and then moving to the mid-point of the remaining levels; reducing your search time to log-base 2 of your MAX_LEVEL.
M Busche
public class ExpCalculator
    private final int MAX_LEVEL = 99;
    private int[] expTable = new int[MAX_LEVEL+1];
    public ExpCalculator() {
        for (int lvl = 1; lvl <= MAX_LEVEL; ++lvl) {
            expTable[lvl] = calcExp(lvl);
    private int calcExp(int level) {
        int points = 0;
        int output = 0;
        for (int lvl = 1; lvl <= level; lvl++) {
            points += Math.floor((double)lvl + 300.0 * Math.pow(2.0, (double)lvl / 7.0));
            if (lvl >= level)
                return output;
            output = (int)Math.floor(points / 4);
        return 0;
    public int getXPForLevel(int level) {
        return expTable[level];
    public int getLevelForXP(int exp) {
        for (int lvl = 1; lvl <= MAX_LEVEL; lvl++) {
            if(expTable[lvl] > exp)
                return lvl;
        return 0;
}

Similar Messages

  • Trying to download game to macbook pro via mifi, need to know if there is faster way of doing this?

    have verizon mifi modem, and downloading a big size game is taking way to long, is there a fast!!!! Way! to download?

    hey! thanks! soonermock!
    i thought that was a possibility but was'nt sure how that would work through a pc,
    i have 2 options and one easier than the other, one would be through a DELL microsoft/windows the other a APPLE desk top,
      iill give it a try, thanks again

  • I have a ! next to some songs and i have to locate them under my music under my documents and when i do it plays in my itunes is there a faster way to do this?once i fix this can i do anything from it happening again?

    i have about 100 songs itunes shows a ! next to it says cannot find please locate i can locate them under my music under my documents and when i do it plays in itunesbut that would take a kong time is there a faster way to fix this?and once i do fix this is there a way for this not to happen again?

    Hello ryane84
    There really is not a faster way to link the songs. You could get the info on the missing songs to see where they sit on your computer and just move the files there before. Then you can organize your library to move them in the iTunes library folder or another place of your choosing. To keep it form happening again, the article does have a section on what to do to keep it organized when new media is added.
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/ts1408
    Regards,
    -Norm G.

  • I have two apple accounts and one of which has my music on. I would like to move this music to the other account. Is there a simple way of doing this?

    I have two apple accounts and one of which has my music on. I would like to move this music to the other account. Is there a simple way of doing this?

    There is currently no way to merge accounts.  The best option is to pick one, and use it consistantly.
    HTH.

  • HI, I recently upgraded my operating system IOS 5.0.1 on an iphone 3gs. MY question is, how do I get the text messaging preview to just pop up so that I can see the name only when the lock screen is on? The conventional ways of doing this aren't working

    HI, I recently upgraded my operating system IOS 5.0.1 on an iphone 3gs. My question is, how do I get the text messaging preview to just pop up so that I can see the name only when the lock screen is on? The conventional ways of doing this, such as using turning off the SMS preview under the "passcode lock", well that option no longer exists, or if it does, I'm somehow missing it.
    When I go to the "messages" setting under settings on my phone, I still don't see an option of turning it off.
    If I can just get the name of the person sending the message, as I had it before, I'd be happy.
    Help!

    That option still exists in Settings > Notifications > Messages > Show Prview (OFF) and View in Lock Screen (ON). Here's how to configure your Notifications and Notification Center for iOS 5: http://iphone-and-i.blogspot.com/2012/01/how-to-customize-notification-center-in .html

  • I would like to duplicate the folders and apps that I have set up on my iPhone to my iPad.  Is there a quick way of doing this without going through the whole process again manually?

    I would like to duplicate the folders and apps that I have set up on my iPhone to my iPad.  Is there a quick way of doing this without going through the whole process again manually?

    You can restore your iPad with your iPhone backup but items that are iPhone only will not transfer.  It should recreate all your folders.  It can't hurt anything to try.

  • Is it possible to copy a DVD into iTunes and then upload it to my iPad? Is there any way of doing this?

    Is it possible to copy a DVD into iTunes and then upload it to my iPad? Is there any way of doing this?

    Sure, just use Handbrake to encode the DVD movie into a format that is playable on iTunes and on your iPad:
    http://handbrake.fr/downloads.php
    Once the encoding is complete, move the movie file from your desktop into iTunes and then sync your iPad.  Presto, the movie is on your iPad!

  • Is there a better way of doing this? (multifileupload/forms/mysql)

    Hi all.
    I've managed to cobble together a page that will let me upload three files paths and three text boxes to a mysql database. the the files also go to specific directories depending on conditions.
    what im looking for is to see if there is a more efficient way of doing this. im mainly looking at the value and name strings along with the preparedstatement insert. i'd like to see if i can make it more dynamic so i don't have to predefine an amount anywhere.
    This code is working as is if anyone wants to use it in it's current state.
    here is the form
    <HTML>
      <HEAD>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"/>
        <TITLE>File Upload Page</TITLE>
      </HEAD>
      <BODY>Upload Files
        <FORM name="filesForm" action="uploadTestProccess.jsp" method="POST" enctype="multipart/form-data">
            File 1:<input type="file" name="file1"/><br/>
                File 2:<input type="file" name="file2"/><br/>
            File 3:<input type="file" name="file3"/><br/>
              text4: <input type="text" name="textField4" value="this is a test4"><br>
              text5: <input type="text" name="textField5" value="this is a test5"><br>
              text6: <input type="text" name="textField6" value="this is a test6"><br>
            <input type="submit" name="submit" value="Upload Files"/>
        </FORM>
      </BODY>
    </HTML>and here is the insert
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
    <%@ page import="org.apache.commons.fileupload.FileItem"%>
    <%@ page import="org.apache.commons.fileupload.*"%>
    <%@ page import="java.util.List"%>
    <%@ page import="java.util.Iterator"%>
    <%@ page import="java.io.File"%>
    <%@ page import="java.sql.*"%>
    <%!
    String value4;
    String value5;
    String value6;
    String name1;
    String name2;
    String name3;
    String dir;
    Connection dbconn;
    ResultSet result;
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    </head>
    <%
            //System.out.println("Content Type ="+request.getContentType());
            DiskFileUpload fu = new DiskFileUpload();
            // If file size exceeds, a FileUploadException will be thrown
            fu.setSizeMax(10000000);
            List fileItems = fu.parseRequest(request);
            Iterator itr = fileItems.iterator();
         for(int i=1; itr.hasNext(); i++){
                FileItem fi = (FileItem)itr.next();
                //Check if not form field so as to only handle the file inputs
                //else condition handles the submit button input
              if(!fi.isFormField()) {
                  out.print(i);
                //out.println("\nNAME: "+fi.getName());
                //out.println("SIZE: "+fi.getSize());
                   if(i==1){
                        name1 = fi.getName();
                        dir = "file1/";
                   } else if (i==2){
                        name2 = fi.getName();
                        dir = "file2/";
                   } else {
                        name3 = fi.getName();
                        dir = "file3/";
                File fNew= new File(application.getRealPath("examples1/" + dir), fi.getName());
                //out.println(fNew.getAbsolutePath());
                fi.write(fNew);
                   out.print("success<br>" + fi.getName() + "<br>");
                  } else {
                     //gets field names and values
                  // out.println("Field ="+fi.getFieldName());
                     String name      = fi.getFieldName();
                   if(i==4){
                        value4 = fi.getString();
                   } else if (i==5){
                        value5 = fi.getString();
                   } else if (i==6) {
                        value6 = fi.getString();
                   String value = fi.getString();
                    out.println("Found field with name <b>"+ name +"</b> and value <b>"+ value  +"</b><br>");
                   Class.forName("org.gjt.mm.mysql.Driver");
                   dbconn = DriverManager.getConnection("jdbc:mysql://localhost:3306/xxx?user=root&password=xxx");
                   PreparedStatement sql = dbconn.prepareStatement("INSERT INTO uploadtest (file1, file2, file3, four, five, six) VALUES (?,?,?,?,?,?)");
                   sql.setString(1, name1);
                   sql.setString(2, name2);
                   sql.setString(3, name3);
                   sql.setString(4, value4);
                   sql.setString(5, value5);
                   sql.setString(6, value6);
                   int result = sql.executeUpdate();
              %>
    <body>
    <!--Upload Successful!!-->
    </body>
    </html>

    anyone?

  • What will happen to the organization of library if I removed the songs from windows explorer? Will iTunes automatically updated without all the deleted songs, or it will indicate 'missing location'? Any fast ways to clear this 'missing location' songs?

    What will happen to the organization of library if I removed the songs from windows explorer?
    Background: I found it easier to identify duplicated songs in windows explorer as the songs will be renamed .... 1.mp3, thus enabling me to remove the duplicated songs; unlike in iTunes where I know the trick of showing duplicate songs, but you don't know which one is the one with 1 at the end of the file name.
    Will iTunes automatically update the library without all the deleted songs, or will it indicate 'missing location' songs? Any fast ways to clear this 'missing location' songs by highlighting them all and delete all at one go?
    Thanks.

    One way is to use iTunes Folder Watch with its option to check for dead tracks on start up.
    Another option is with a set of Lost & Found playlists.
    Lost & Found
    Create a playlist called Found, select everything in Music and drag it into the Found playlist. Create a smart playlist called Lost matching All the rules Playlist is Music and Playlist is not Found. Your lost tracks will be in this playlist. You can delete them all with a Ctrl-A to select them and Shift-Delete to remove them.
    You can then delete the Lost & Found playlists.
    tt2

  • HT4413 I want to transfer about three thousand photos on my MacAir to my iMac. Any suggestions on the best way of doing this?

    I want to transfer about three thousand photos on my MacAir to my iMac. Any suggestions on the best way of doing this?

    Are the photos in iPhoto?
    If they are, you can simply copy your iPhoto Library (located in your Pictures folder) to a thumb drive or external drive and then copy it over to your other Mac. This will only work if the iMac has the same version (or later version) of iPhoto as does the Macbook Air.  Then on the iMac, if you want to combine this new library with the existing one over there, use iPhoto Library Manager (a free download program).
    If you want to copy over only a portion of that iPhoto library, iPhoto Library Manager can create a smaller library containing just the photos you want to include. Then copy that smaller library.

  • Please help!!! Need another way of doing this!!

    Hello i was wondering if someone could help me with this. I am sure there could be a different way of doing this. Maybe setting up an arraylist or an array and searching through it until the selected item in the combo Box is equal to the item in the array
    list??
    //MY CODE
     private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
                if (comboBox1.SelectedItem == "Toyota")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Ford")
                { string file = "txtFiles/fordModels.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Hyundai")
                { string file = "txtFiles/hyundaiModels.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Chevrolet")
                { string file = "txtFiles/chevroletModels.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Honda")
                { string file = "txtFiles/hondaModels.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Dodge")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Ram")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Nissan")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Kia")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Mazda")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "GMC")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Volkswagen")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Jeep")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Subaru")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Mercedes-Benz")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "BMW")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Chrysler")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Mitsubishi")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Audi")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Acura")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Lexus")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Buick")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Infinity")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Cadillac")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
                else if (comboBox1.SelectedItem == "Fiat")
                { string file = "txtFiles/toyotaModel.txt"; string send = rModelInfo(file); }
    And this si where i am using the "File" variable
     // Opens Models file depending on The "Get" string. Also Storing the Stored txt data into Array list
            StreamReader objReaderFour = new StreamReader(get);
            string sLineFour = "";
            ArrayList Models= new ArrayList();
            while (sLineFour != null)
                sLineFour = objReaderFour.ReadLine();
                if (sLineFour != null)
                    Models.Add(sLineFour);
            objReaderFour.Close();
            // converting arraylist into array
            String[] hhModels = (String[])Models.ToArray(typeof(string));
            comboBox2.Items.AddRange(hhModels);

    Personally I like this one the most.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace WindowsFormsApplication1
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private BindingList <CarLink> CarLinks = new BindingList<CarLink>();
    private void Form1_Load(object sender, EventArgs e)
    CarLinks.Add(new CarLink() {Name="Buick", Link = "Whatever"});
    CarLinks.Add(new CarLink() {Name = "BMW", Link = "Whatelse" });
    comboBox1.DataSource = CarLinks;
    comboBox1.DisplayMember = "Name";
    comboBox1.ValueMember = "Link";
    comboBox1.SelectedIndexChanged += new System.EventHandler(Selected_indexchanged);
    public class CarLink
    public string Name {get;set;}
    public string Link {get;set;}
    private void Selected_indexchanged(object sender, EventArgs e)
    MessageBox.Show(comboBox1.SelectedValue.ToString());
    Success
    Cor

  • I don't want to write too much code is there a different way of doing this

    I am writing a precedure to check on the max test scores for different codes ('S01','S02'.S03') --there are more
    then I need to insert the table if the record with the best score does not exists for example for b.sortest_tesc_code = 'BSV', I am writing a cursor
    for each code (.sortest_tesc_code = 'S01') is there a way to do this different? so I cant do something like a.sortest_tesc_code in ('S01','S02'.S03') and store in a
    variable then insert, the problem is that you can have a student that have only one test other that have two etc..etc.. is not consistent, also If the b.sortest_tesc_code = 'BSV') is already in the table I don't do an insert I will have to do an update if the sortest_test_score is greater since the student can submit scores more than once... In another words check if the record exists( b.sortest_tesc_code = 'BSV') if is there compare with the new max score and if the new max score is greater then update.. If the score (by code) is not in the table insert
    Hope this is clear, this is what I have, I now it will work but it will be too much code..check for exists and not exists in two different precedures..
    Thank you
    CURSOR get_the_max_scores_S01_cur IS
                SELECT
                 sortest_pidm, a.sortest_test_score, a.sortest_tesc_code,
                 a.sortest_test_date,a.sortest_equiv_ind
                FROM
                saturn.spriden, saturn.sortest a, saturn.stvtesc
               WHERE 
               a.sortest_pidm = spriden_pidm
              AND stvtesc_code = a.sortest_tesc_code
              AND spriden_change_ind IS NULL
           -----and   a.sortest_tesc_code in ('S01','S02'.S03')
           AND a.sortest_tesc_code = 'S01'
           --and spriden_id = p_student_id  --
           ---for test purposes
           AND sortest_pidm = 133999 ----THE WILL BE A PARAMETER
           AND a.sortest_test_score =
                  (SELECT MAX (b.sortest_test_score)
                     FROM saturn.sortest b
                    WHERE a.sortest_tesc_code = b.sortest_tesc_code
                          AND a.sortest_pidm = b.sortest_pidm)
                                AND NOT EXISTS
                  (SELECT 1   FROM    saturn.sortest b
                  WHERE    A.sortest_tesc_code = b.sortest_tesc_code
                          AND a.sortest_pidm = b.sortest_pidm     
                          and   b.sortest_tesc_code = 'BSV');
         BEGIN
                     UTL_FILE.fclose_all;
                     v_file_handle := UTL_FILE.fopen (v_out_path, v_out_file, 'a');
                    UTL_FILE.put_line (v_file_handle,
                          CHR (10) || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
                   UTL_FILE.put_line (v_file_handle, 'sortest_best_sct_scorest');
                   --check for an open cursor before opening
                   IF get_the_max_scores_S01_cur%ISOPEN
                       THEN
                        CLOSE get_the_max_scores_S01_cur;
                   END IF;
                OPEN get_the_max_scores_S01_cur;
                 LOOP
                       FETCH get_the_max_scores_S01_cur
                       INTO v_pidm, v_tscore, v_testcode,
                               v_test_date, v_equiv_ind;
                       EXIT WHEN get_the_max_scores_S01_cur%NOTFOUND;
                   IF  get_the_max_scores_S01_cur%FOUND 
                    THEN
                       INSERT INTO saturn.sortest
                       (sortest_pidm,sortest_tesc_code,sortest_test_date,sortest_test_score,
                        sortest_activity_date,sortest_equiv_ind,sortest_user_id,sortest_data_origin)
                        VALUES
                        v_pidm,
                       'BSV',
                        v_test_date,
                         v_tscore,
                         sysdate, 
                        v_equiv_ind,
                        p_user,
                        'best_test_scores process'
                   END IF;    
                   END LOOP;
                   COMMIT;
                   ---Initialize variables
                    v_pidm := NULL;
                    v_test_date := NULL; 
                    v_tscore  := NULL; 
                    v_equiv_ind :=  NULL;
                    v_testcode  :=  NULL;
                 CLOSE get_the_max_scores_S01_cur;
    ----then another do the same for S02...S03

    Thank you, here is the code, I change the name of the tables, but it is the same concept.what I need is to extract the max score for each code (s01,s02,s03,s04)
    then insert a record with a different code in the same table
    BSM     Best Math SAT (S01)                              
    BSW     Best writing SAT (S04)     
    BSC     Best READING SAT (S03)     
    BSE     Best READING SAT (S02)     
    I need to be able to check if the BS codes are already in the table (BSM...BSC..) IF they are not do an insert and if they are do an update get the maximun score
    again (the students can submit more than one score form the same code and any date) and if the maximun is different(greater) of what is already in the database (with the BSM...BSC.. codes) do an update, IF NOT if is the same or less don't update...
    I need the PERSON table because I need to use the ID as a parameter they (user) can run the process for one ID or all the records in the table TEST
    Thank you, I hope is clear
    create table TEST
    TEST_PIDM                  NUMBER(8)            NOT NULL,
    TEST_TESC_CODE        VARCHAR2(4 CHAR)     NOT NULL,
    TEST_TEST_DATE        DATE                 NOT NULL,
    TEST_TEST_SCORE       VARCHAR2(5 CHAR)     NOT NULL,
    TEST_ACTIVITY_DATE    DATE                 NOT NULL,
    TEST_EQUIV_IND        VARCHAR2(1 CHAR)     NOT NULL
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'EB' ,TO_DATE( '01-JUN-2004', 'DD-MON-YYYY'),'710',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'M2' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'710',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S01' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'750',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S01' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'720',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S02' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'740',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S02' ,TO_DATE( '05-JUL-2005', 'DD-MON-YYYY'),'730',SYSDATE,'N'
    FROM DUAL ;
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S03' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'780',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S03' ,TO_DATE( '05-JUL-2005', 'DD-MON-YYYY'),'740',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S04' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'770',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S04' ,TO_DATE( '05-JUL-2005', 'DD-MON-YYYY'),'740',SYSDATE,'N'
    FROM DUAL; 
    CREATE TABLE PERSON
      PERSON_PIDM                NUMBER(8)         NOT NULL,
      PERSON_ID                  VARCHAR2(9 CHAR)  NOT NULL
    INSERT INTO  PERSON
    ( PERSON_PIDM ,   PERSON_ID)
    SELECT
    128019,'003334556'
    FROM DUAL ;
    CREATE TABLE VALTSC
    VALTSC_CODE             VARCHAR2(4 CHAR)     NOT NULL,
      VALTSC_DESC             VARCHAR2(30 CHAR)
    INSERT INTO  VALTSC
    VALTSC_CODE,
      VALTSC_DESC 
    SELECT
    'S01' ,
    'XXS01'
    FROM DUAL; 
      INSERT INTO  VALTSC
    VALTSC_CODE,
      VALTSC_DESC 
    SELECT
    'S02' ,
    'XXS02'
    FROM DUAL 
      INSERT INTO  VALTSC
    VALTSC_CODE,
      VALTSC_DESC 
    SELECT
    'S03' ,
    'XXS03'
    FROM DUAL; 
    INSERT INTO  VALTSC
    VALTSC_CODE,
      VALTSC_DESC 
    SELECT
    'S04' ,
    'XXS04'
    FROM DUAL; 

  • I have an iPod which i currently sync on my iMac, I want to sync it on my Apple mac pro, how do I do this? Is there a way of doing this without restoring my iPod?

    I have an iPod which I currently sync on my iMac, but I want to sync it on my Apple mac pro, how do I do this? Is there a way of doing it without restoring my iPod?

    Post here:
    https://discussions.apple.com/community/ipod

  • What is optimize way of doing this

    Hi
    I have following tables
    T1
    Part number
    Model Year
    Program
    Lead Program
    sample data:
    123 P1 1978 N
    123 P1 1977 N
    123 P2 1978 N
    T2
    Program
    Model Year
    Active flag
    sample data:
    P1 1978 Y
    P1 1977 Y
    P2 1978 Y
    T3
    Program
    Model Year
    Date
    sample data:
    P1 1978 12/10/2006
    P1 1977 20/10/2008
    P2 1978 30/10/2007
    Processing Steps:
    1. Identify all Distinct Part Numbers from T1
    2. For each Part Number , Find all Distinct (Program Model, Year)
    3. From T2, identify and remove inactive records with (Program Model, Year) combination
    4. For all active (Program Model, Year), extract date from T3
    5. Identify one (Program Model, Year) combination with min date.
    6. For all records from T1 , matching individual distinct part number, update Lead Program to Y for (Program Model, Year) identified in step 5.
    I was thinking about
    a. define cursor for 1st step
    b. for each part in cursor , will execute join qry for 2,3,4 (on T1,T2,T3) & store results in temp table
    c. Include rownum condition in above qry to return one program,model year with min date
    d. update lead pgm field in T1 for corresponding program, model year combn
    Can anybody suggest any other way of optimizing this?I feel since my first cursor may contain thousands/millions of record, will there be any performance problem?

    Safari > Preferences > Security > Enable Java

  • HT204088 Why can't you print a cd jewel case listing of songs using iTunes. Is there some other way of doing this without using iTunes?

    Why can't you print a cd jewel case listing of songs using iTunes. Is there some other way to do this without using iTunes?

    Hi spider1950,
    As long as you have the most recent update of iTunes (11.0.4), you should be able to print a jewel case insert directly from iTunes. You may find the following page useful:
    Apple Support: Print CD Inserts
    https://www.apple.com/findouthow/music/itunes.html#makecd-printinserts
    Regards,
    - Brenden

Maybe you are looking for

  • Upload data from excel in compatable to all formats

    Hi Gurus, I am using FM and in my system MS-2007 is installed and every thing is working fine. But when i use this FM in the system installed with MS-2003 i am getting an error because the 2003 excel will only support 65,000 rows. The requirement is

  • I can no longer open any pdf files.

    As of yesterday, pdf's don't open!  I've tried the latest Adobe Reader, Preview, and Safari. Never had this problem before.  I've reinstalled Reader and restarted my computer (running OSX 10.8.3), no help.  This problem is true for my new and old pdf

  • Values of select-option in various variants

    Hi all, does anybody know a report to determine the values of a specific select-option in various variants of a program? I know the function module RS_VARIANT_CONTENTS to get the values of select-options in one variant of a program (TABLES-parameter

  • Migration assistant doesn't connect

    We're trying to migrate from a G5 imac to a new 24" imac, and even though we can boot the old imac into target mode and get the firewire logo, the new imac never "sees" the disk and migration assistant won't start. Tried 2 different cables. Ideas?

  • VHS into my iMac?

    Hi, After looking through many posts about this topic, I am just confused. I have taken super8 analog video tapes and put them on a VHS tape. Now I want to convert that VHS tape into a DVD. Is there an easy way to do this? I have a brand new iMac. Do