Txt to XL to 2D array

HI
How can I convert the attach txt file to XL to 2D array. This is laser beam profile data from a CCD camera. Array size 640x480.
I want to read the third colum (value) only and conver into 2D array to display beam profile
Thanks
Attachments:
Laser beam data.zip ‏968 KB

Hi,
I work for a laser company myself and have done something simliar to what you are trying. I have added in some more functionality to the first VI I posted. I wanted to show you the steps that I have gone through to get it into a 3D graph and get the line profile at the peak. I might be mixing my columns and rows up but I am sure you can debug all that.
All that its left is for you to go away and work out your FWHM, 1/e or 1/e^2 spot size converting pixels to microns.
@smercurio_fc (Saverio, right?): I was concerned that the multiple space delimiter (8 space representation of a tab is my guess) wasn't constant because of field padding. So thats while I choose the read a line at time method. This was instead of reading in a 10meg file and manipulating it in a loop or using the spreadsheet to array functionality. At the same time I thought I would demonstrate to Kamalm2 that you can use file functions to get your data from the file while keeping the memory consumption down. Of course, you are absolutely right, it is slower. Visumans clocked in a ~3secs and my version was ~7 secs. To me thats not a big deal. I would not have posted the VI if the OP had to run my file and go a away and make a wee cup of tea and come back to it while it was loading.
Right, its Saturday afternoon and I am off to play Sins of a Solar Empire which I highly recommend.
Hope this helps you out
cheers
David
Message Edited by David Crawford on 10-31-2009 12:56 PM
Attachments:
Read and Plot Laser Beam Data V2.vi ‏137 KB
Read and Plot Laser Beam Data V2.jpg ‏399 KB

Similar Messages

  • Noob: read entries in a file.txt into a 2 dim array

    I'm a newbie trying to learn Java & Swing and I'm attempting to use the Jtable element to display really simple car records in CSV format in my UI. The values in my file are like so:
    1970,Chevy,Chevelle,16000
    1972,Oldsmobile,Cutlass,15000
    1969,Chevy,Camaro,22000
    1971,Plymouth,Barracuda,19500
    and as far as I can tell, from the documentation i've read
    (http://java.sun.com/docs/books/tutorial/uiswing/components/table.html), the suggested way for it to work should just be to read in the records to the JTable as a two dimensional object array. But I keep getting java.lang.NullPointerException.
    what am i doing wrong? the tokens seem to print out just fine, but I can't read them into the array. i tried a lot of things, spent a good deal of time with my Java book and Mr. Google, but nothing seems to be working and i'm stuck. As far as i can tell, I should be able to:
    1. use buffered file reader to read the records
    2. use either split() or token to break the records out by the comma delimiter
    3. pack the data into a two dimensional array
    4. feed that into the JTable constructor.
    right? well, I'm stuck on step 3. - here's some code:
    try
                FileReader fr = new FileReader("carStock.txt");
                BufferedReader br = new BufferedReader(fr);
                String newline=null;
                int i=0;
                String myCarData[][] = null;       
                while((newline=br.readLine())!=null)
                    //carInfoFromFile.add(newline);       
                    String[] theLine = newline.split(",");
                    for(String token:theLine)
                        System.out.println(token);   
                        myCarData[0]=token;
    myCarData[i][1]=token;
    myCarData[i][2]=token;
    myCarData[i][3]=token;
    System.out.println(myCarData[i][0]);
    i++;
    catch (FileNotFoundException e)
    e.printStackTrace();
    catch (IOException e)
    e.printStackTrace();

    ok, so far i have learned that i did not initialize my array correctly. so now i have:
    Object myCarData[][] = new String[4][4];
    but i still do not see how to successfully iterate over all of the csv records that get read in from my text file: i.e. now i tried:
    while((newline=br.readLine())!=null)
       //Parse the line being read in
       String[] theLine = newline.split(",");
       myCarData[0][0] = theLine[0];
       myCarData[0][1] = theLine[1];
       myCarData[0][2] = theLine[2];
       myCarData[0][3] = theLine[3];
    //now what????  how do i get to the next "theLine?"
    }and i do in fact have a proper car class, but i don't understand how i would use it it this scenario.
    I realize I should be using two for loops to populate the array, but i am doing it longways first. But I can't figure it out longways. I know this is probably a simple matter of syntax. What am I missing?

  • How to read .txt file into a 2D array ? Pls help !

    I have a .txt file with contents as shown :
    1 0 1 0 1 0 1 0
    1 0 1 1 1 0 0 1
    1 0 1 0 1 0 1 0
    1 0 1 1 1 0 0 1
    1 0 1 1 1 0 0 1
    1 0 1 1 1 0 0 1
    1 0 1 1 1 0 0 1
    1 0 1 1 1 0 0 1
    1 0 1 1 1 0 0 1
    1 0 1 1 1 0 0 1
    and so on...until 10 samples in total.
    How do I create a class which has a method (which I can call later) to put all those binary digits in a 2-D array ? The method should automatically extract data from the .txt file and put it into a 2-D array. How do I do that please ?
    Please help someone ? It's pretty urgent....:-(

    This one takes the cake: essentially the same question, cross-posted 11 times:
    http://forum.java.sun.com/thread.jsp?thread=560218&forum=57&message=2752602
    http://forum.java.sun.com/thread.jsp?thread=560219&forum=426&message=2752600
    http://forum.java.sun.com/thread.jsp?thread=560220&forum=31&message=2752599
    http://forum.java.sun.com/thread.jsp?thread=560220&forum=31&message=2752583
    http://forum.java.sun.com/thread.jsp?thread=560220&forum=31&message=2752519
    http://forum.java.sun.com/thread.jsp?thread=560219&forum=426&message=2752518
    http://forum.java.sun.com/thread.jsp?thread=560218&forum=57&message=2752517
    http://forum.java.sun.com/thread.jsp?thread=559967&forum=31&message=2750787
    http://forum.java.sun.com/thread.jsp?thread=559968&forum=57&message=2750767
    http://forum.java.sun.com/thread.jsp?thread=559967&forum=31&message=2750751
    http://forum.java.sun.com/thread.jsp?thread=559964&forum=426&message=2750734
    DON'T CROSS-POST! Send your question to one forum. You waste people's time
    doing anything else.
    How To Ask Questions The Smart Way

  • How to skip certain lines for a txt file and insert into array

    so here is my question:
    i had a file to read, and it requires to input into the array starting from a certain line
    example:
    4
    john 25 M
    mary 22 F
    lee 20 M
    faye 10 F
    faye john
    mary john
    mary faye
    i want to insert the friend list, starting 5th line into a 2d array, which is the int from first line +1.
    can someone help me with it?
    i believe there is a skip method and stuff..
    but just dont know how to use it
    may someone tell me how to do tat?

    the thing is i think that takes too long and it is not efficient..
    however...i just solved it with a better method
    Scanner in = new Scanner (reader);
    int size = Integer.parseInt(in.next());
    BufferedReader insert = new BufferedReader(new FileReader(new File(input)));
    String line = null;
    int count = 0;
    int startAtLineNo =size+1; // 0-based
    while ((line = insert.readLine()) != null) {
    if (count >= startAtLineNo) {
    /* do stuff */
    System.out.println(line);
    // else ignore
    count++;
    thanks anyways

  • How to get number of rows and columns in a two dimensional array ?

    Hello,
    What would be the simplest way to get number of rows and columns in a two dimensional array represented as integers ?
    I'm looking for another solution as For...Each loop in case of large arrays.
    Regards,
    Petri

    Hi Petri,
    See a attached txt file for obtaining two arrays with upper and lower index values
    Regards
    Ray
    Regards
    Ray Farmer
    Attachments:
    Get2DArrayIndex.txt ‏2 KB

  • Linear search between two arrays

    I'm having trouble with the comparison of an array of football teams and an array of team names that may or may not be in the football team array. I have read both .txt files into their own arrays and parsed the team array with substring in order to isolate the team name. I know I can read both the search array and the team names individually because I tested it with a println. I think my problem is in the comparison "if" statement.
        public void seqSearch()//Sequential(linear) search
        int j=0, s;
        //int m = j+1;
            for(s=0; s<searchSize; s++)//increments through the search array
              for(j=0; j<teamArray.length; j++)//increments through the team array
               if(teamArray[j].getName().equals(search[s]))//I think this is where the problem is
                   System.out.println("Found " + teamArray[j].getName() + "after" + j + "searches.");
                   break;                 
               else
                   System.out.println(teamArray[j].getName());//prints through all of the names during each search for testing
                   if(j == teamArray.length-1)
                       System.out.println("Can't find " + search[s] + " after " + j + " searches");
            }//end for
        }//end seqSearch()My output prints the names of each team on their own line and at the end it always says that it can't find each search term.
    Ex.
    Bears
    Bengals
    Bills
    Vikings
    Can't find Bills after 32 searches
    Bears
    Bengals
    Bills
    Vikings
    Can't find Eagles after 32 searches
    etc
    I though that .equals was the way to compare in this situation. Any idea what I'm doing wrong?

    Dave,
    teamArray[j].getName().equals(search[s]))what is the implementation class which is returned from "search[s]" and from "eamArray[j].getName()"
    if both of them are java.lang.String then us "equalsIgnoreCase" instead of "equals"
    if the implementation class is different, then you have to override the equal method and implement your own.
    Regards,
    Alan Mehio
    London, UK

  • Hex string to hex array

    Hello,
    I have a hex string that contains the address then word:
    0 8E39
    1 60E3
    2  1B
    3  42
    4  100
    5  0
    I am trying to generate two arrays, one with the address in two bytes and the other with the word in four bytes so that I will end up:
    00 8E39
    01 60E3
    02 001B
    03 0042
    04 0100
    05 0000
    Any help will be greatly appreciated!
    Thanks,
    hiNi.
    Solved!
    Go to Solution.
    Attachments:
    hex_word_with_addr.txt ‏1 KB
    string to array.vi ‏13 KB

    You can also directly use "read from spreadsheet file" (but you need to convert to U16 later).
    hiNI wrote:
    I am trying to generate two arrays, one with the address in two bytes and the other with the word in four bytes so that I will end up:
    You said you wanted two arrays, so you still need to slice out the two columns.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    string to arrayMOD.vi ‏17 KB
    stringToArrayMOD.png ‏28 KB

  • Read two different arrays and display

    I have a text file, which has 1000 of entries in the way mentioned below:
    Kozos customer
    sabze employee
    I am reading the content of text file and saving as an arrays.
    $global:Content = get-content info.txt
    $global:Name=$Content | foreach {
    $hashTab=@{Name="" ; Info=""}
    $hashTab.Name, $hashTab.Info=$_.Trim() -split '\s+'
    New-Object PSObject -Property $hashTab
    $global:Names=$ServerList | select -ExpandProperty Name
    $global:Infos=$ServerList | select -ExpandProperty Info
    How do I read two arrays, I mean read the values of two arrays one by one and display the result as:
    Names Infos
    Kozos Customer
    sabze employee

    We get that you are unable to do this, but it is still not clear precisely what it is that you want, a two-dimensional array, or a structure such as SeanQuinlan suggested? Also:
    there seems no reason for any of the variables to be global in scope.
    Where is the $serverlist variable defined?
    what relationship is there between the file you mention and the data in the $serverlist variable?
    Your code has three arrays, $name, $names, and $infos; which two of these do you want to combine into a single array? If $names and $infos, would this work for you:
        $namesNinfos = $serverlist | select name,info
    I suggest that you describe your situation without trying to state it in powershell (as that is partly where your problem lies). You could, for example, show sample content of the file and each of the two arrays, and show what this would look like in your
    desired two-dimensional array, perhaps like this:
    file info.txt
    Kozos customer
    sabze employee
    array 1:
    Kozos
    sabze
    array 2:
    customer
    employee
    resultant 2D array
    column 1 2
    row
    1 Kozos customer
    2 sabze employee
    As an aside, it could be that we are getting confused by the term "array". languages such as fortran and basic support multidimensional arrays in which each element is addressed by a set of integer indices, the most common form being row and column, as in
    a spreadsheet.
    In Powershell, arrays are generally one dimensional, with a single numerical index being used to select a single element ($row3 = $array[2]). That element can optionally have multiple values if it is defined as an array or a hash. This is referred to as
    a "jagged array" as each element of the array may not all have the same number of sub-elements as each other.
    Powershell also supports true multidimensional arrays, however, these seem fairly rarely used, I suspect because jagged arrays generally provide more easily used functionality.
    You can get more details on this from
    here and
    here.
    This, then, leads to my final question:
    what type of two-dimensional array are you looking for, and how will your script be processing it?
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • Importing Text File data

    At the moment I know how to enter data from a text file into
    a flash file, for example this is my 'Monday.txt' file (a cut down
    version)
    "AK2~Hairdressing Level 2 Year 2 Of
    2","HDRN2AK2-2B1FA","12:30","14:30"," 10/ 9/2007","M316"
    "AK2~Hairdressing NVQ L2 (Grp
    A)","HDRN2AK2-1B1FA","12:30","14:30"," 10/ 9/2007","M316"
    "AK2~Hairdressing NVQ L2 (Grp
    B)","HDRN2AK2-1B1FB","12:30","14:30"," 10/ 9/2007","M308"
    "Beauty Therapy Level 1 Grp D","BTHN1-1B1FD","9:00","10:30","
    10/ 9/2007","M306"
    "Beauty Therapy NVQ Level 1 Grp
    A","BTHN1-1B1FA","9:00","10:30"," 10/ 9/2007","M306"
    "Beauty Therapy NVQ Level 1 Grp
    B","BTHN1-1B1FB","9:00","10:30"," 10/ 9/2007","M306"
    "Beauty Therapy NVQ Level 1 Grp
    C","BTHN1-1B1FC","9:00","10:30"," 10/ 9/2007","M306"
    "Beauty Therapy NVQ Level 2 Grp
    A","BTHN2-1B1FA","9:00","12:00"," 10/ 9/2007","M217"
    "Beauty Therapy NVQ Level 2 Grp
    A","BTHN2-1B1FA","12:30","14:00"," 10/ 9/2007","M306"
    "Beauty Therapy NVQ Level 2 Grp
    D","BTHN2-1B1FD","12:00","15:00"," 10/ 9/2007","M217"
    Using this coding, I now know how to get it into columns in a
    tabbed layout
    var lv:LoadVars = new LoadVars();
    lv.onLoad = func;
    lv.load("Monday.txt");
    function func(ok) {
    if (!ok) {
    trace("file not loaded.");
    return;
    var tf:TextFormat = new TextFormat();
    tf.tabStops = [220, 340, 390, 440, 490, 520];
    tf.font = "Verdana";
    tf.size = 9;
    var nextD:Number = _root.getNextHighestDepth();
    var w:Number = Stage.width - 20;
    var h:Number = Stage.height - 20;
    var txt:TextField = _root.createTextField("schedule", nextD,
    10, 10, w, h);
    txt.wordWrap = txt.multiline = /*txt.border =*/ true;
    txt.autoSize = true;
    txt.setNewTextFormat(tf);
    var temp1:Array =
    unescape(this).split("=&onLoad")[0].split("\n");
    for (var i:Number = 0; i < temp1.length; i++) {
    var temp2:String = temp1
    .split(",").join("\t").split("\"").join("");
    txt.text = (txt.text.length > 0 ? txt.text : "") + temp2
    + (i == temp1.length-1 ? " " : " \n");
    The problem I have now is, in the text file I am going to
    have upto 120-130 of these records, now the maximum I can fit onto
    the screen is 20, is there a way I can split this text file up so I
    can show Page 1/7, 2/7, 3/7, 4/7, 5/7, 6/7 and 7/7, where it
    switches over automatically via a timer of some sort, say after 20
    seconds. Any help would be greatly appreciated, thanks

    sure. there are many ways to do this.
    one would be to use one textfield and load all your text into
    it. use a timer like setInterval() to periodically increase the
    scroll property of your textfield by its bottomScroll property.
    you'll need to fill your last page with carriage returns or
    new lines so the last page can scroll to the top of your
    textfield.

  • Error Compiliing:symbol  : class TextFileInput

    Greetings,
    I have two computers with the java compiler installed. On one, the program works perfect. On the other computer, it doent.
    Here is the error message I get when I compile the program:
    symbol : class TextFileInput
    location: class Project1
              TextFileInput dataFile = new TextFileInput(f);
    ^
    C:\cs212\Project1.java:66: cannot find symbol
    symbol : class TextFileInput
    location: class Project1
              TextFileInput dataFile = new TextFileInput(f);
    ^
    2 errors
    Tool completed with exit code 1
    The program works fine on the other computer. I have the same compiler version installed on both computers. I tried making changes to the class path but doesnt seem to work. What should I do. Please help
    Below is the code of my program:
    public class Project1
         * Main method.
         * @param args command-line arguments - inputFile.txt needed
         public static void main(String[] args)
              String filename      = args[0];
    final int ELEMENTS      = 10;
              String[] namesArray = new String[ELEMENTS];
              String[] speciesArray = new String[ELEMENTS];
              int     [] ageArray = new int [ELEMENTS];
              if (args.length != 1)
                   System.out.println("You have entered wrong "
                   + "argument information. Exiting the system");
              System.exit(0);
         }//end if args.length != 1
              int arraySize = readFile(args[0],speciesArray, namesArray, ageArray);
              displayResults(speciesArray, namesArray, ageArray, arraySize);
              sort(speciesArray, namesArray, ageArray, arraySize);
              displayResults(speciesArray, namesArray, ageArray, arraySize);
    }// end main
         * readfile method.- Read data from inputFile.txt and place
         * it into Arrays
         * @param f - the name of the file - inputFile.txt
         * @param sp - speciesArray - Array that contains the species
         * @param na - nameArray - Array that contains the animal names
         * @param a - ageArray - Array that contains animal age
         * @return - the size of the array to a variable called arraySize
         public static int readFile(String f, String[] sp, String[] na, int[] a)
              TextFileInput dataFile = new TextFileInput(f);
    //final String lineBreak = System.getProperty("line.separator");
              // Input the first line from the file:
         String line      = dataFile.readLine();
         int lengthFilled      = 0;
              // Read the content of the file and place it in a string of arrays
              while (line != null )
                   StringTokenizer st = new StringTokenizer(line, "|");
                   String species = st.nextToken();
                   String name = st.nextToken();
                   int age = Integer.parseInt(st.nextToken());
                   boolean validate = isValidSpecies(species);
    if (validate != true)
                        System.out.println("The line: \""+ line + "\""+ " in the file is not valid");
                   System.out.println("It will not be included in the array");
                   line = dataFile.readLine();
              else
                        sp[lengthFilled] = species;
                        na[lengthFilled] = name;
                        a [lengthFilled] = age;
                        lengthFilled++;
                   line                = dataFile.readLine();
              }//end else
              }// end while loop
         dataFile.close();
              return lengthFilled;
         }//end readFile
         * isValidSpecies method. - Makes sure the species is either a CAT or DOG
         * @param s - the species value of the array at xxx position
         * @return - it will return true if the species name is either CAT or DOG
         * - else it will return false.
         public static boolean isValidSpecies(String s)
              if ( (s.compareTo("DOG") == 0) || (s.compareTo("CAT") == 0))
              return true;
         else
              return false;
    }//end isValidSpecies
    * sort method. - It sorts the array based on name.
    * @param sp - speciesArray - Array that contains the species
    * @param na - nameArray - Array that contains the animal names
    * @param a - ageArray - Array that contains animal age
    * @param length - the size of the partially filled array
         public static void sort(String[] sp, String[] na, int[] a, int length)
              //Sort the array using selection sort array.
              for (int i = 0; i < length; i++)
                   // Find the lowest-valued element in
                   // the subarray from index i up to
                   // index length - 1
                   int indexLowest = i;
                   for (int j = i + 1; j < length; j++)
                        if ( na.compareTo(na[indexLowest]) <= 0 )
                             indexLowest = j;
                        // Put the lowest-valued element at
                   // index i, swapping if necessary:
                        if ( na[indexLowest].compareTo(na[i]) <= 0 )
                             String tempName = na[indexLowest];
                             String tempSpecie = sp[indexLowest];
                             int tempnumb = a [indexLowest];
                             na[indexLowest] = na[i];
                             sp[indexLowest] = sp[i];
                             a [indexLowest] = a [i];
                             na[i] = tempName;
                        sp[i] = tempSpecie;
                             a [i]           = tempnumb;
                        }//end if
    }//for loop
         }//for loop
    }//end sort method
    * displayResults method. - Display the info from the arrays to a JOptionPane.
    * @param sp - speciesArray - Array that contains the species
    * @param na - nameArray - Array that contains the names
    * @param a - ageArray - Array that contains animal age
    * @param length - the size of the partially filled array
         public static void displayResults(String[] sp, String[] na, int[] a, int length)
              JTextArea textArea = new JTextArea();
         textArea.setEditable(false);
         final String lineBreak = System.getProperty("line.separator");
              for (int i = 0; i < length; i++)
              textArea.append(sp[i] + " " + na[i] + " " + a[i] + lineBreak);
              JOptionPane.showMessageDialog(null, textArea);
    }// end displayResults
    }//end class Project1

    How could that be, that the class TexFileinput is
    missing. The installation of java, I believe version
    1.5.0_04 was done at the same time on both machines.That class is one of your classes. It's not part of Java. Look for it.
    Anyway, the classpath seem to be the same?
    I know the path is the same on both computers, but I
    dont know where to check for the class path.Type echo %classpath% at a cmd prompt.
    Thanks alot for your prompt response!!!!

  • Program does not wait for user input

    Hi everyone,
    i am working on a program and there are 2 problems that i can't figure out. Since they are 2 different topics, I will do 2 posts.
    Just to give you some background on the program, it is a program that reads 3 txt files into 4 different arrays. The files contain student names, student ID numbers, number of credits and gpas. the user enters the names of the 3 txt files and then is given a list of options to choose from. I am having problems with option 7.
    The code lists the student information, but it does not stop to request the name of the student from the user. Instead, it prints the system out line requesting the name and then prints all the information for every student in the file. I can't figure out why this is happening. Here is the code for the option:
                    else if (choice == 7)
                            System.out.print("Please enter the student's name: ");
                            student_name= sc.nextLine();
                            for (q= 0; q <= num_students-1; q++)
                                    if (student_name.equalsIgnoreCase(studentname[q]))
                                            System.out.println();
                                            System.out.println("Student's name: " + studentname[q]);
                                            System.out.println(studentname[q] + "'s ID#: " + studentid[q]);
                                            System.out.println(studentname[q] + "'s number of credits: " + credits[q]);
                                            System.out.println(String.format(studentname[q] + "'s gpa: " + "%.2f",gpa[q]));
                                            if (gpa[q] < 2.00)  
                                                    System.out.println(studentname[q] + "'s status: can't graduate");
                                            else if (gpa[q] >= 3.45 && gpa[q] < 3.65)
                                            else if (gpa[q] >= 3.45 && gpa[q] < 3.65)
                                                    System.out.println(studentname[q] + "'s status: cum laude");
                                            else if (gpa[q] >= 3.65 && gpa[q] < 3.85)
                                                    System.out.println(studentname[q] + "'s status: magna");
                                            else if (gpa[q] >= 3.85)
                                                    System.out.println(studentname[q] + "'s status: summa");
                                            else if (gpa[q] >= 2.00 && gpa[q] < 3.45)
                                                    System.out.println(studentname[q] + "'s status: ");
                    System.out.println();
                    System.out.println("1.  List student names");
                    System.out.println("2.  List credits");
                    System.out.println("3.  Show total credits");
                    System.out.println("4.  List gpas");
                    System.out.println("5.  List gpas in ascending order");
                    System.out.println("6.  Show weighted average of gpas");
                    System.out.println("7.  Show information about a given student");
                    System.out.println("8.  Add a new student");
                    System.out.println("9.  Quit");
                    System.out.println();
                    System.out.println();
                    System.out.print("Enter your choice: ");
                    choice= sc.nextInt();
                    System.out.println();
                    // Option 9 quits program
    }          Any help you can give me would be greatly appreciated.

    Ok, I tinkered with the code a bit. Now it will show the info for only one student, however, it is not giving any results. Here is the output I am getting:
    Enter your choice: 7
    Please enter the student's name: mary
    Student's name: null
    null's ID#: null
    null's number of credits: 0
    null's gpa: 0.00
    null's status: can't graduate
    1. List student names
    2. List credits
    3. Show total credits
    4. List gpas
    5. List gpas in ascending order
    6. Show weighted average of gpas
    7. Show information about a given student
    8. Add a new student
    9. Quit
    Here is the updated code:
                    else if (choice == 7)
                            System.out.print("Please enter the student's name: ");
                            student_name= sc.next();
                            for (q= 0; q < num_students; q++)
                                    if (student_name.equalsIgnoreCase(studentname[q]))
                                            System.out.println();
                                            System.out.println("Student's name: " + studentname[q]);
                                            System.out.println(studentname[q] + "'s ID#: " + studentid[q]);
                                            System.out.println(studentname[q] + "'s number of credits: " + credits[q]);
                                            System.out.println(String.format(studentname[q] + "'s gpa: " + "%.2f",gpa[q]));
                                            if (gpa[q] < 2.00)
                                                    System.out.println(studentname[q] + "'s status: can't graduate");
                                            else if (gpa[q] >= 3.45 && gpa[q] < 3.65)
                                                    System.out.println(studentname[q] + "'s status: cum laude");
                                           else if (gpa[q] >= 3.65 && gpa[q] < 3.85)
                                                    System.out.println(studentname[q] + "'s status: magna");
                                            else if (gpa[q] >= 3.85)
                                                    System.out.println(studentname[q] + "'s status: summa");
                                            else if (gpa[q] >= 2.00 && gpa[q] < 3.45)
                                                    System.out.println(studentname[q] + "'s status: ");
                                    else
                                            System.out.println("Student name not on file.");
                    System.out.println();
                    System.out.println("1.  List student names");
                    System.out.println("2.  List credits");
                    System.out.println("3.  Show total credits");
                    System.out.println("4.  List gpas");
                    System.out.println("5.  List gpas in ascending order");
                    System.out.println("6.  Show weighted average of gpas");
                    System.out.println("7.  Show information about a given student");
                    System.out.println("8.  Add a new student");
                    System.out.println("9.  Quit");
                    System.out.println();
                    System.out.println();
                    System.out.print("Enter your choice: ");
                    choice= sc.nextInt();
                    System.out.println();  
                    // Option 9 quits program
    }

  • Why won't mailchimp get it?

    Hello everyone. I'm using a mailchimp form on a website. Ive copied and pasted it, and everything looks good on-line, but once you fill out the form and hit subscribe, the form clears out. It's suppose to direct you to a mailchimp page saying they need to verify your email. I'm wondering if its my "action" that's not filled out right? Can anyone give my some help?
    My "action" is:
    http://mosotomoss.us6.list-manage.com/subscribe/post?u=8561959ec7cc67b9ddb43123f&id=fdca2c 92ad
    Here is my code:
    <html>
    <head>
    <title>Home</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    #apDiv1 {
              position:absolute;
              left:709px;
              top:305px;
              width:377px;
              height:469px;
              z-index:1;
              overflow: scroll;
    #apDiv2 {
              position:absolute;
              left:171px;
              top:215px;
              width:384px;
              height:477px;
              z-index:1;
              overflow: scroll;
    #apDiv3 {
              position:absolute;
              left:705px;
              top:296px;
              width:378px;
              height:474px;
              z-index:2;
              overflow: scroll;
    .style1 {color: #FF0000}
    #apDiv4 {
              position:absolute;
              left:708px;
              top:300px;
              width:383px;
              height:471px;
              z-index:3;
              overflow: scroll;
    #apDiv5 {
              position:absolute;
              left:706px;
              top:301px;
              width:387px;
              height:473px;
              z-index:3;
    #apDiv6 {
              position:absolute;
              left:709px;
              top:289px;
              width:383px;
              height:473px;
              z-index:1;
              overflow: scroll;
    -->
    </style>
    <script type="text/javascript">
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    MM_reloadPage(true);
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    //-->
    </script>
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('rollover/images/home_03.jpg','rollover/images/us_03.jpg','rollo ver/images/services_03.jpg','rollover/images/team.jpg','rollover/images/store_03.jpg','rol lover/images/campaign_03.jpg','rollover/images/101_03.jpg','rollover/images/stories_03.jpg ','rollover/images/press_03.jpg','rollover/images/events_03.jpg')">
    <!-- ImageReady Slices (Mosotomoss Website) -->
    <div id="apDiv6">
      <form name="form1" method="post" action="">
        <label><!-- Begin MailChimp Signup Form -->
    <link href="http://cdn-images.mailchimp.com/embedcode/classic-081711.css" rel="stylesheet" type="text/css">
    <style type="text/css">
              #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
              /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
                 We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
    </style>
    <div id="mc_embed_signup">
    <form action="http://mosotomoss.us6.list-manage.com/subscribe/post?u=8561959ec7cc67b9ddb43123f&id=fdca2c 92ad" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
              <h2>Subscribe to our mailing list</h2>
    <div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
    <div class="mc-field-group">
              <label for="mce-EMAIL">Your Email  <span class="asterisk">*</span>
    </label>
              <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
    </div>
    <div class="mc-field-group">
              <label for="mce-FNAME">First Name  <span class="asterisk">*</span>
    </label>
              <input type="text" value="" name="FNAME" class="required" id="mce-FNAME">
    </div>
    <div class="mc-field-group">
              <label for="mce-LNAME">Last Name  <span class="asterisk">*</span>
    </label>
              <input type="text" value="" name="LNAME" class="required" id="mce-LNAME">
    </div>
    <div class="mc-field-group">
              <label for="mce-MMERGE3">Zip code:  <span class="asterisk">*</span>
    </label>
              <input type="text" value="" name="MMERGE3" class="required" id="mce-MMERGE3">
    </div>
    <div class="mc-field-group input-group">
        <strong>I like to stay in the know  <span class="asterisk">*</span>
    </strong>
        <ul><li><input type="radio" value="Newsletter" name="MMERGE4" id="mce-MMERGE4-0"><label for="mce-MMERGE4-0">Newsletter</label></li>
    </ul>
    </div>
    <div class="mc-field-group input-group">
        <strong>Email Format </strong>
        <ul><li><input type="radio" value="html" name="EMAILTYPE" id="mce-EMAILTYPE-0"><label for="mce-EMAILTYPE-0">html</label></li>
    <li><input type="radio" value="text" name="EMAILTYPE" id="mce-EMAILTYPE-1"><label for="mce-EMAILTYPE-1">text</label></li>
    <li><input type="radio" value="mobile" name="EMAILTYPE" id="mce-EMAILTYPE-2"><label for="mce-EMAILTYPE-2">mobile</label></li>
    </ul>
    </div>
              <div id="mce-responses" class="clear">
                        <div class="response" id="mce-error-response" style="display:none"></div>
                        <div class="response" id="mce-success-response" style="display:none"></div>
              </div>          <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </form>
    </div>
    <script type="text/javascript">
    var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]= 'LNAME';ftypes[2]='text';fnames[3]='MMERGE3';ftypes[3]='zip';fnames[4]='MMERGE4';ftypes[4] ='radio';
    try {
        var jqueryLoaded=jQuery;
        jqueryLoaded=true;
    } catch(err) {
        var jqueryLoaded=false;
    var head= document.getElementsByTagName('head')[0];
    if (!jqueryLoaded) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
        head.appendChild(script);
        if (script.readyState && script.onload!==null){
            script.onreadystatechange= function () {
                  if (this.readyState == 'complete') mce_preload_check();
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
    head.appendChild(script);
    var err_style = '';
    try{
        err_style = mc_custom_error_style;
    } catch(e){
        err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
    var head= document.getElementsByTagName('head')[0];
    var style= document.createElement('style');
    style.type= 'text/css';
    if (style.styleSheet) {
      style.styleSheet.cssText = err_style;
    } else {
      style.appendChild(document.createTextNode(err_style));
    head.appendChild(style);
    setTimeout('mce_preload_check();', 250);
    var mce_preload_checks = 0;
    function mce_preload_check(){
        if (mce_preload_checks>40) return;
        mce_preload_checks++;
        try {
            var jqueryLoaded=jQuery;
        } catch(err) {
            setTimeout('mce_preload_check();', 250);
            return;
        try {
            var validatorLoaded=jQuery("#fake-form").validate({});
        } catch(err) {
            setTimeout('mce_preload_check();', 250);
            return;
        mce_init_form();
    function mce_init_form(){
        jQuery(document).ready( function($) {
          var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){}  };
          var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
          $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
          options = { url: 'http://mosotomoss.us6.list-manage.com/subscribe/post-json?u=8561959ec7cc67b9ddb43123f&id=f dca2c92ad&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
                        beforeSubmit: function(){
                            $('#mce_tmp_error_msg').remove();
                            $('.datefield','#mc_embed_signup').each(
                                function(){
                                    var txt = 'filled';
                                    var fields = new Array();
                                    var i = 0;
                                    $(':text', this).each(
                                        function(){
                                            fields[i] = this;
                                            i++;
                                    $(':hidden', this).each(
                                        function(){
                                            var bday = false;
                                            if (fields.length == 2){
                                                bday = true;
                                                fields[2] = {'value':1970};//trick birthdays into having years
                                                  if ( fields[0].value=='MM' && fields[1].value=='DD' && (fields[2].value=='YYYY' || (bday && fields[2].value==1970) ) ){
                                                            this.value = '';
                                                                                                  } else if ( fields[0].value=='' && fields[1].value=='' && (fields[2].value=='' || (bday && fields[2].value==1970) ) ){
                                                            this.value = '';
                                                                                                  } else {
                                                                                                      if (/\[day\]/.test(fields[0].name)){
                                                          this.value = fields[1].value+'/'+fields[0].value+'/'+fields[2].value;                                                                                                  
                                                                                                      } else {
                                                          this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
                            return mce_validator.form();
                        success: mce_success_cb
          $('#mc-embedded-subscribe-form').ajaxForm(options);
    function mce_success_cb(resp){
        $('#mce-success-response').hide();
        $('#mce-error-response').hide();
        if (resp.result=="success"){
            $('#mce-'+resp.result+'-response').show();
            $('#mce-'+resp.result+'-response').html(resp.msg);
            $('#mc-embedded-subscribe-form').each(function(){
                this.reset();
        } else {
            var index = -1;
            var msg;
            try {
                var parts = resp.msg.split(' - ',2);
                if (parts[1]==undefined){
                    msg = resp.msg;
                } else {
                    i = parseInt(parts[0]);
                    if (i.toString() == parts[0]){
                        index = parts[0];
                        msg = parts[1];
                    } else {
                        index = -1;
                        msg = resp.msg;
            } catch(e){
                index = -1;
                msg = resp.msg;
            try{
                if (index== -1){
                    $('#mce-'+resp.result+'-response').show();
                    $('#mce-'+resp.result+'-response').html(msg);           
                } else {
                    err_id = 'mce_tmp_error_msg';
                    html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';
                    var input_id = '#mc_embed_signup';
                    var f = $(input_id);
                    if (ftypes[index]=='address'){
                        input_id = '#mce-'+fnames[index]+'-addr1';
                        f = $(input_id).parent().parent().get(0);
                    } else if (ftypes[index]=='date'){
                        input_id = '#mce-'+fnames[index]+'-month';
                        f = $(input_id).parent().parent().get(0);
                    } else {
                        input_id = '#mce-'+fnames[index];
                        f = $().parent(input_id).get(0);
                    if (f){
                        $(f).append(html);
                        $(input_id).focus();
                    } else {
                        $('#mce-'+resp.result+'-response').show();
                        $('#mce-'+resp.result+'-response').html(msg);
            } catch(e){
                $('#mce-'+resp.result+'-response').show();
                $('#mce-'+resp.result+'-response').html(msg);
    </script>
    <!--End mc_embed_signup--></label>
      </form>
    </div>
    <script type="text/javascript">
    var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]= 'LNAME';ftypes[2]='text';fnames[3]='MMERGE3';ftypes[3]='zip';fnames[4]='MMERGE4';ftypes[4] ='radio';
    try {
        var jqueryLoaded=jQuery;
        jqueryLoaded=true;
    } catch(err) {
        var jqueryLoaded=false;
    var head= document.getElementsByTagName('head')[0];
    if (!jqueryLoaded) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
        head.appendChild(script);
        if (script.readyState && script.onload!==null){
            script.onreadystatechange= function () {
                  if (this.readyState == 'complete') mce_preload_check();
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
    head.appendChild(script);
    var err_style = '';
    try{
        err_style = mc_custom_error_style;
    } catch(e){
        err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
    var head= document.getElementsByTagName('head')[0];
    var style= document.createElement('style');
    style.type= 'text/css';
    if (style.styleSheet) {
      style.styleSheet.cssText = err_style;
    } else {
      style.appendChild(document.createTextNode(err_style));
    head.appendChild(style);
    setTimeout('mce_preload_check();', 250);
    var mce_preload_checks = 0;
    function mce_preload_check(){
        if (mce_preload_checks>40) return;
        mce_preload_checks++;
        try {
            var jqueryLoaded=jQuery;
        } catch(err) {
            setTimeout('mce_preload_check();', 250);
            return;
        try {
            var validatorLoaded=jQuery("#fake-form").validate({});
        } catch(err) {
            setTimeout('mce_preload_check();', 250);
            return;
        mce_init_form();
    function mce_init_form(){
        jQuery(document).ready( function($) {
          var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){}  };
          var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
          $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
          options = { url: 'http://mosotomoss.us6.list-manage2.com/subscribe/post-json?u=8561959ec7cc67b9ddb43123f&id= fdca2c92ad&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
                        beforeSubmit: function(){
                            $('#mce_tmp_error_msg').remove();
                            $('.datefield','#mc_embed_signup').each(
                                function(){
                                    var txt = 'filled';
                                    var fields = new Array();
                                    var i = 0;
                                    $(':text', this).each(
                                        function(){
                                            fields[i] = this;
                                            i++;
                                    $(':hidden', this).each(
                                        function(){
                                            var bday = false;
                                            if (fields.length == 2){
                                                bday = true;
                                                fields[2] = {'value':1970};//trick birthdays into having years
                                                  if ( fields[0].value=='MM' && fields[1].value=='DD' && (fields[2].value=='YYYY' || (bday && fields[2].value==1970) ) ){
                                                            this.value = '';
                                                                                                  } else if ( fields[0].value=='' && fields[1].value=='' && (fields[2].value=='' || (bday && fields[2].value==1970) ) ){
                                                            this.value = '';
                                                                                                  } else {
                                                                                                      if (/\[day\]/.test(fields[0].name)){
                                                          this.value = fields[1].value+'/'+fields[0].value+'/'+fields[2].value;                                                                                                  
                                                                                                      } else {
                                                          this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
                            return mce_validator.form();
                        success: mce_success_cb
          $('#mc-embedded-subscribe-form').ajaxForm(options);
    function mce_success_cb(resp){
        $('#mce-success-response').hide();
        $('#mce-error-response').hide();
        if (resp.result=="success"){
            $('#mce-'+resp.result+'-response').show();
            $('#mce-'+resp.result+'-response').html(resp.msg);
            $('#mc-embedded-subscribe-form').each(function(){
                this.reset();
        } else {
            var index = -1;
            var msg;
            try {
                var parts = resp.msg.split(' - ',2);
                if (parts[1]==undefined){
                    msg = resp.msg;
                } else {
                    i = parseInt(parts[0]);
                    if (i.toString() == parts[0]){
                        index = parts[0];
                        msg = parts[1];
                    } else {
                        index = -1;
                        msg = resp.msg;
            } catch(e){
                index = -1;
                msg = resp.msg;
            try{
                if (index== -1){
                    $('#mce-'+resp.result+'-response').show();
                    $('#mce-'+resp.result+'-response').html(msg);           
                } else {
                    err_id = 'mce_tmp_error_msg';
                    html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';
                    var input_id = '#mc_embed_signup';
                    var f = $(input_id);
                    if (ftypes[index]=='address'){
                        input_id = '#mce-'+fnames[index]+'-addr1';
                        f = $(input_id).parent().parent().get(0);
                    } else if (ftypes[index]=='date'){
                        input_id = '#mce-'+fnames[index]+'-month';
                        f = $(input_id).parent().parent().get(0);
                    } else {
                        input_id = '#mce-'+fnames[index];
                        f = $().parent(input_id).get(0);
                    if (f){
                        $(f).append(html);
                        $(input_id).focus();
                    } else {
                        $('#mce-'+resp.result+'-response').show();
                        $('#mce-'+resp.result+'-response').html(msg);
            } catch(e){
                $('#mce-'+resp.result+'-response').show();
                $('#mce-'+resp.result+'-response').html(msg);
    </script>
    <!--End mc_embed_signup--></label>
    </form>
    <script type="text/javascript">
    var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]= 'LNAME';ftypes[2]='text';fnames[3]='MMERGE3';ftypes[3]='zip';fnames[4]='MMERGE4';ftypes[4] ='radio';
    try {
        var jqueryLoaded=jQuery;
        jqueryLoaded=true;
    } catch(err) {
        var jqueryLoaded=false;
    var head= document.getElementsByTagName('head')[0];
    if (!jqueryLoaded) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
        head.appendChild(script);
        if (script.readyState && script.onload!==null){
            script.onreadystatechange= function () {
                  if (this.readyState == 'complete') mce_preload_check();
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
    head.appendChild(script);
    var err_style = '';
    try{
        err_style = mc_custom_error_style;
    } catch(e){
        err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
    var head= document.getElementsByTagName('head')[0];
    var style= document.createElement('style');
    style.type= 'text/css';
    if (style.styleSheet) {
      style.styleSheet.cssText = err_style;
    } else {
      style.appendChild(document.createTextNode(err_style));
    head.appendChild(style);
    setTimeout('mce_preload_check();', 250);
    var mce_preload_checks = 0;
    function mce_preload_check(){
        if (mce_preload_checks>40) return;
        mce_preload_checks++;
        try {
            var jqueryLoaded=jQuery;
        } catch(err) {
            setTimeout('mce_preload_check();', 250);
            return;
        try {
            var validatorLoaded=jQuery("#fake-form").validate({});
        } catch(err) {
            setTimeout('mce_preload_check();', 250);
            return;
        mce_init_form();
    function mce_init_form(){
        jQuery(document).ready( function($) {
          var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){}  };
          var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
          $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
          options = { url: 'http://mosotomoss.us6.list-manage.com/subscribe/post-json?u=8561959ec7cc67b9ddb43123f&id=f dca2c92ad&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
                        beforeSubmit: function(){
                            $('#mce_tmp_error_msg').remove();
                            $('.datefield','#mc_embed_signup').each(
                                function(){
                                    var txt = 'filled';
                                    var fields = new Array();
                                    var i = 0;
                                    $(':text', this).each(
                                        function(){
                                            fields[i] = this;
                                            i++;
                                    $(':hidden', this).each(
                                        function(){
                                            var bday = false;
                                            if (fields.length == 2){
                                                bday = true;
                                                fields[2] = {'value':1970};//trick birthdays into having years
                                                  if ( fields[0].value=='MM' && fields[1].value=='DD' && (fields[2].value=='YYYY' || (bday && fields[2].value==1970) ) ){
                                                            this.value = '';
                                                                                                  } else if ( fields[0].value=='' && fields[1].value=='' && (fields[2].value=='' || (bday && fields[2].value==1970) ) ){
                                                            this.value = '';
                                                                                                  } else {
                                                                                                      if (/\[day\]/.test(fields[0].name)){
                                                          this.value = fields[1].value+'/'+fields[0].value+'/'+fields[2].value;                                                                                                  
                                                                                                      } else {
                                                          this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
                            return mce_validator.form();
                        success: mce_success_cb
          $('#mc-embedded-subscribe-form').ajaxForm(options);
    function mce_success_cb(resp){
        $('#mce-success-response').hide();
        $('#mce-error-response').hide();
        if (resp.result=="success"){
            $('#mce-'+resp.result+'-response').show();
            $('#mce-'+resp.result+'-response').html(resp.msg);
            $('#mc-embedded-subscribe-form').each(function(){
                this.reset();
        } else {
            var index = -1;
            var msg;
            try {
                var parts = resp.msg.split(' - ',2);
                if (parts[1]==undefined){
                    msg = resp.msg;
                } else {
                    i = parseInt(parts[0]);
                    if (i.toString() == parts[0]){
                        index = parts[0];
                        msg = parts[1];
                    } else {
                        index = -1;
                        msg = resp.msg;
            } catch(e){
                index = -1;
                msg = resp.msg;
            try{
                if (index== -1){
                    $('#mce-'+resp.result+'-response').show();
                    $('#mce-'+resp.result+'-response').html(msg);           
                } else {
                    err_id = 'mce_tmp_error_msg';
                    html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';
                    var input_id = '#mc_embed_signup';
                    var f = $(input_id);
                    if (ftypes[index]=='address'){
                        input_id = '#mce-'+fnames[index]+'-addr1';
                        f = $(input_id).parent().parent().get(0);
                    } else if (ftypes[index]=='date'){
                        input_id = '#mce-'+fnames[index]+'-month';
                        f = $(input_id).parent().parent().get(0);
                    } else {
                        input_id = '#mce-'+fnames[index];
                        f = $().parent(input_id).get(0);
                    if (f){
                        $(f).append(html);
                        $(input_id).focus();
                    } else {
                        $('#mce-'+resp.result+'-response').show();
                        $('#mce-'+resp.result+'-response').html(msg);
            } catch(e){
                $('#mce-'+resp.result+'-response').show();
                $('#mce-'+resp.result+'-response').html(msg);
    </script>
    <!--End mc_embed_signup-->
    <script type="text/javascript">
    var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]= 'LNAME';ftypes[2]='text';fnames[3]='MMERGE3';ftypes[3]='zip';fnames[4]='MMERGE4';ftypes[4] ='radio';
    try {
        var jqueryLoaded=jQuery;
        jqueryLoaded=true;
    } catch(err) {
        var jqueryLoaded=false;
    var head= document.getElementsByTagName('head')[0];
    if (!jqueryLoaded) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
        head.appendChild(script);
        if (script.readyState && script.onload!==null){
            script.onreadystatechange= function () {
                  if (this.readyState == 'complete') mce_preload_check();
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
    head.appendChild(script);
    var err_style = '';
    try{
        err_style = mc_custom_error_style;
    } catch(e){
        err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
    var head= document.getElementsByTagName('head')[0];
    var style= document.createElement('style');
    style.type= 'text/css';
    if (style.styleSheet) {
      style.styleSheet.cssText = err_style;
    } else {
      style.appendChild(document.createTextNode(err_style));
    head.appendChild(style);
    setTimeout('mce_preload_check();', 250);
    var mce_preload_checks = 0;
    function mce_preload_check(){
        if (mce_preload_checks>40) return;
        mce_preload_checks++;
        try {
            var jqueryLoaded=jQuery;
        } catch(err) {
            setTimeout('mce_preload_check();', 250);
            return;
        try {
            var validatorLoaded=jQuery("#fake-form").validate({});
        } catch(err) {
            setTimeout('mce_preload_check();', 250);
            return;
        mce_init_form();
    function mce_init_form(){
        jQuery(document).ready( function($) {
          var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){}  };
          var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
          $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
          options = { url: 'http://mosotomoss.us6.list-manage.com/subscribe/post-json?u=8561959ec7cc67b9ddb43123f&id=f dca2c92ad&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
                        beforeSubmit: function(){
                            $('#mce_tmp_error_msg').remove();
                            $('.datefield','#mc_embed_signup').each(
                                function(){
                                    var txt = 'filled';
                                    var fields = new Array();
                                    var i = 0;
                                    $(':text', this).each(
                                        function(){
                                            fields[i] = this;
                                            i++;
                                    $(':hidden', this).each(
                                        function(){
                                            var bday = false;
                                            if (fields.length == 2){
                                                bday = true;
                                                fields[2] = {'value':1970};//trick birthdays into having years
                                                  if ( fields[0].value=='MM' && fields[1].value=='DD' && (fields[2].value=='YYYY' || (bday && fields[2].value==1970) ) ){
                                                            this.value = '';
                                                                                                  } else if ( fields[0].value=='' && fields[1].value=='' && (fields[2].value=='' || (bday && fields[2].value==1970) ) ){
                                                            this.value = '';
                                                                                                  } else {
                                                                                                      if (/\[day\]/.test(fields[0].name)){
                                                          this.value = fields[1].value+'/'+fields[0].value+'/'+fields[2].value;                                                                                                  
                                                                                                      } else {
                                                          this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
                            return mce_validator.form();
                        success: mce_success_cb
          $('#mc-embedded-subscribe-form').ajaxForm(options);
    function mce_success_cb(resp){
        $('#mce-success-response').hide();
        $('#mce-error-response').hide();
        if (resp.result=="success"){
            $('#mce-'+resp.result+'-response').show();
            $('#mce-'+resp.result+'-response').html(resp.msg);
            $('#mc-embedded-subscribe-form').each(function(){
                this.reset();
        } else {
            var index = -1;
            var msg;
            try {
                var parts = resp.msg.split(' - ',2);
                if (parts[1]==undefined){
                    msg = resp.msg;
                } else {
                    i = parseInt(parts[0]);
                    if (i.toString() == parts[0]){
                        index = parts[0];
                        msg = parts[1];
                    } else {
                        index = -1;
                        msg = resp.msg;
            } catch(e){
                index = -1;
                msg = resp.msg;
            try{
                if (index== -1){
                    $('#mce-'+resp.result+'-response').show();
                    $('#mce-'+resp.result+'-response').html(msg);           
                } else {
                    err_id = 'mce_tmp_error_msg';
                    html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';
                    var input_id = '#mc_embed_signup';
                    var f = $(input_id);
                    if (ftypes[index]=='address'){
                        input_id = '#mce-'+fnames[index]+'-addr1';
                        f = $(input_id).parent().parent().get(0);
                    } else if (ftypes[index]=='date'){
                        input_id = '#mce-'+fnames[index]+'-month';
                        f = $(input_id).parent().parent().get(0);
                    } else {
                        input_id = '#mce-'+fnames[index];
                        f = $().parent(input_id).get(0);
                    if (f){
                        $(f).append(html);
                        $(input_id).focus();
                    } else {
                        $('#mce-'+resp.result+'-response').show();
                        $('#mce-'+resp.result+'-response').html(msg);
            } catch(e){
                $('#mce-'+resp.result+'-response').show();
                $('#mce-'+resp.result+'-response').html(msg);
      </script>
    <label></label>
          <label></label>
    <table width="1281" height="1025" border="0" cellpadding="0" cellspacing="0" id="Table_01">
              <tr>
                        <td colspan="33">
                                  <img src="images/index_01.jpg" width="1280" height="10" alt=""></td>
                        <td>
                                  <img src="images/spacer.gif" width="1" height="10" alt=""></td>
              </tr>
              <tr>
                        <td colspan="6">
                                  <img src="images/index_02.jpg" width="256" height="1" alt=""></td>
                        <td rowspan="6">
                                  <a href="service.html"><img src="images/index_03.jpg" alt="" width="113" height="56" border="0" id="Image3" onMouseOver="MM_swapImage('Image3','','rollover/images/services_03.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
    <td colspan="26">
                                  <img src="images/index_04.jpg" width="911" height="1" alt=""></td>
                        <td>
                                  <img src="images/spacer.gif" width="1" height="1" alt=""></td>
              </tr>
              <tr>
                        <td rowspan="16">
                                  <img src="images/index_05.jpg" width="97" height="1013" alt=""></td>
                        <td colspan="2" rowspan="4">
                                  <a href="index.html"><img src="images/index_06.jpg" alt="" width="80" height="53" border="0" id="Image1" onMouseOver="MM_swapImage('Image1','','rollover/images/home_03.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
    <td rowspan="10">
                                  <img src="images/index_07.jpg" width="17" height="977" alt=""></td>
                        <td rowspan="4">
                                  <a href="us.html"><img src="images/index_08.jpg" alt="" width="44" height="53" border="0" id="Image2" onMouseOver="MM_swapImage('Image2','','rollover/images/us_03.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
    <td rowspan="10">
                                  <img src="images/index_09.jpg" width="18" height="977" alt=""></td>
                        <td colspan="4">
                                  <img src="images/index_10.jpg" width="112" height="1" alt=""></td>
                        <td rowspan="4">
                                  <a href="store.html"><img src="images/index_11.jpg" alt="" width="91" height="53" border="0" id="Image5" onMouseOver="MM_swapImage('Image5','','rollover/images/store_03.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
    <td colspan="4">
                                  <img src="images/index_12.jpg" width="174" height="1" alt=""></td>
                        <td rowspan="4">
                                  <a href="1on1.html"><img src="images/index_13.jpg" alt="" width="68" height="53" border="0" id="Image7" onMouseOver="MM_swapImage('Image7','','rollover/images/101_03.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
    <td colspan="16">
                                  <img src="images/index_14.jpg" width="466" height="1" alt=""></td>
                        <td>
                                  <img src="images/spacer.gif" width="1" height="1" alt=""></td>
              </tr>
              <tr>
                        <td rowspan="9">
                                  <img src="images/index_15.jpg" width="15" height="976" alt=""></td>
                        <td colspan="2" rowspan="2">
                                  <a href="team.html"><img src="images/index_16.jpg" alt="" width="82" height="51" border="0" id="Image4" onMouseOver="MM_swapImage('Image4','','rollover/images/team.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
    <td rowspan="15">
                                  <img src="images/index_17.jpg" width="15" height="1012" alt=""></td>
                        <td rowspan="15">
                                  <img src="images/index_18.jpg" width="18" height="1012" alt=""></td>
                        <td colspan="2" rowspan="5">
                                  <a href="campaign.html"><img src="images/index_19.jpg" alt="" width="136" height="56" border="0" id="Image6" onMou

    It should be worth noting that the MailChimp support article (not a Dreamweaver support article, mind you) that SnakEyez02 provided can be found on the http://kb.mailchimp.com support page that I suggested to you in the fisrt reply. Unfortunaltely your blatant incompetence prevented you from finding the article yourself.
    There's an old proverb that says "Give a man a fish, feed him for a day. Teach a man to fish and they're fed for life." I'm glad you got your fish today and I hope one day you'll learn to fish.
    P.S. Maybe this can be a lesson to others: If you are advised to visit the official support page for 3rd party service that you're using then it might be best to look for answers there (hint: because that's where the answer is). AKA don't be lazy and wait for someone to hold your hand. Find it yourself and you'll be more self-sufficient. Then again if you're using absolute position in your layout and you have obvious difficulty forming complete words and sentences you might need someone to guide you through your issues at a very slow pace in order to keep up with your apparent cognitive disabilities.
    best,
    Shocker

  • Php form processing script

    Hi. I got a program to write a php form processing script. My submit form is for photo submission to my domain email. I published to site and did a test to see if it works i got this error:
    Warning: require_once(F:\Domains\mydomain\mydomain.com\wwwroot/includes/Upload_Photos-lib.php): failed to open stream: No such file or directory in F:\Domains\mydomain\mydomain.com\wwwroot\Upload_Photos.php on line 24 Fatal error: require_once(): Failed opening required 'F:\Domains\mydomain\mydomain.com\wwwroot/includes/Upload_Photos-lib.php' (include_path='.;C:\php\pear') in F:\Domains\mydomain\mydomain.com\wwwroot\Upload_Photos.php on line 24
    What does this mean? How can i solve this so that i can process my form?

    See if the below form helps: You need to create a folder on your server named - upload - this is where any files uploaded will be stored (make sure the folder is writable. Also change the email address where the information that someone who has uploaded a file will go to. Look for the following in the code: $to ="XXXXXXXXXXXX.com";
    <!DOCTYPE html>
    <head>
    <meta charset="UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    #wrapper {
    width: 400px;
    margin: 0 auto;
    </style>
    </head>
    <body>
    <div id="wrapper">
    <?php if(isset($_POST['submit'])) {
    $name = trim($_POST['name']);
    if(empty($name)) {
    $error['name'] = "Please provide your name";
    $location = trim($_POST['location']);
    if(empty($location)) {
    $error['location'] = "Please provide your location";
    $email = trim($_POST['email']);
    if(empty($email)) {
    $error['email'] = "Please provide your email";
    $category_description = trim($_POST['category_description']);
    if(empty($category_description)) {
    $error['category_description'] = "Please provide the category or description";
    $terms_conditions = trim($_POST['terms_conditions']);
    if(empty($terms_conditions)) {
    $error['terms_conditions'] = "Please accept the terms & conditions";
    $allowedExts = array(
       "doc",
      "docx",
            "rtf",
            "txt",
            "pdf",
            "jpeg",
            "jpg",
    $allowedMimeTypes = array(
      'application/msword',
            'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'application/rtf',
            'application/x-rtf',
            'text/richtext',
            'text/rtf',
            'application/plain',
      'application/pdf',
      'image/gif',
      'image/jpeg',
    $extension = end(explode(".", $_FILES["file"]["name"]));
    if (empty($_FILES["file"]["name"])) {
        $selectFile = 'Please select a file to upload';
    elseif ( ! ( in_array($extension, $allowedExts ) ) ) {
      $fileTypeNotAllowed = 'File type not allowed';
    elseif ($_FILES["file"]["size"] > 2097152) {
      $fileTooLarge = 'Please provide a smaller file';
    elseif (file_exists("upload/" . $_FILES["file"]["name"])) {
    $fileExists = $_FILES["file"]["name"] . " already exists, Please change the file name ";
    elseif (in_array( $_FILES["file"]["type"], $allowedMimeTypes ) )
        if(!empty($_POST['terms_conditions'])) {
    move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);
        $fileName = $_FILES["file"]["name"];
        $fileUploadSuccessful = 'File uploaded successfully';
    $to = "XXXXXXXXXXXXX.com";
    $subject   = "Upload to website";
    $headers  = "From: $email\r\n";
    $headers .= "Reply-To: $email\r\n";
    $message = "Name: $name\n\n";
    $message .= "Location: $location\n\n";
    $message .= "Email Address: $email\n\n";
    $message .= "Category/Description: $category_description\n\n";
    $message .= "File: $fileName\n\n";
    mail($to, $subject, $message, $headers);
    $sent = "Mail was sent successfully";
    ?>
    <h1>Form</h1>
    <?php
    foreach ($error as $value) {
        echo "<p>".$value."</p>";
    if(isset($formFieldError)) {
    echo "<p>".$formFieldError."</p>";
    if(isset($selectFile)) {
    echo "<p>".$selectFile."</p>";
    if(isset($fileTypeNotAllowed)) {
    echo "<p>".$fileTypeNotAllowed."</p>";
    if(isset($fileTooLarge)) {
    echo "<p>".$fileTooLarge."</p>";
    if(isset($fileExists)) {
    echo "<p>".$fileExists."</p>";
    if(isset($fileUploadSuccessful)) {
    echo "<p>".$fileUploadSuccessful."</p>";
    ?>
    <form action="upload_file.php" method="post"
    enctype="multipart/form-data">
    <p>
    <label for="name">Name<br>
    <input type="text" name="name" id="name" value="<?php if(isset($name)) {echo $name; }  ?>"/>
    </label>
    </p>
    <p>
    <label for="location">Location<br>
    <input type="text" name="location" id="location" value="<?php if(isset($location)) {echo $location; }  ?>"/>
    </label>
    </p>
    <p>
    <label for="email">Email<br>
    <input type="text" name="email" id="email" value="<?php if(isset($email)) {echo $email; }  ?>" />
    </label>
    </p>
    <p>
    <label for="category_description">Category and Description<br>
    <input type="text" name="category_description" id="category_description" value="<?php if(isset($category_description)) {echo $category_description; }  ?>" />
    </label>
    </p>
    <p>
    <label for="file">File Attachment:<br>
    <input type="file" name="file" id="file" />
    </label>
    </p>
    <p>
    <label for="terms_conditions">Terms & Conditions:
    <input name="terms_conditions" type="checkbox" value="accept" <?php if(isset($_POST['terms_conditions'])) {echo "checked"; }  ?>> (Please check)
    </label>
    </p>
    <input type="submit" name="submit" value="Submit" />
    </form>
    </div>
    </body>
    </html>

  • Simple FFT graph problem

    Hi to all,
    The problem is: I have  a 100Hz sine in a text file (sampled at
    800Hz), and when try to see the FFT of that signal, the dominant
    frenquency should be around 100Hz, but doesn't happen. I think that's
    because the "Convert to Dynamic Data" VI, but how can I solve this? The
    VI and the signal file goes in attachment.
    Thanks in advance.
    Ricardo.
    Attachments:
    analise_sinal.vi ‏81 KB
    sine_100hz.txt ‏685 KB

    Before converting the array into the Dynamic Data type, convert it into a waveform type.  Feed the data into the Y element of the waveform cluster and enter the inverse of the sampling rate into the dt element of the waveform cluster.  Feed the waveform data into they Covert to Dynamic Data and change the properties of it to accept a single 1D waveform.  Your frequency info will then appear in the FFT.
    Looking at your data, if this sine wave is at 100 Hz then it is not sampled at 800 Hz.  It is sampled at a higher rate.
    Randall Pursley
    Attachments:
    Data Convert.PNG ‏14 KB

  • Run dos command from java

    May I ask how I should write if I want to execute a dos command in java? The command is :
    "C:\Program Files\Real\realproducer\rmeditor -i abc.rm -d abc.txt". Should I use array?
    Thanks!

    why an array ?
    String command = "C:\\Program Files\\Real\\realproducer\\rmeditor -i abc.rm -d abc.txt";
    Process p = Runtime.getRuntime().exec( command );what about the seach function on the left side ? ;-)
    tobias

Maybe you are looking for