Hello and a question about Arrays

Hello! I am a student working towards a CIS degree, I'm only in my second term, so I have a long way to go still. Next term (starts in November) I'll be starting my first language (Java) so I figured this is a good spot to register and get acquainted with all of you.
Anyway, right now I'm in a programming logic and design class. In this class we use Pseudocode to get the basic constructs of programming down without doing anything language specific. I just read the chapter that introduces Arrays and had a difficult time following it. Could any of you take a minute and give me your definition of what exactly an array is and how it works? Or maybe point me to a link that might help me? I've got the 'jist' of it, but the book jumps right into algorithms using arrays without much explaination as to what they are.
Thanks for any response and for helping a programming "n00b".
-Rawhide

>
Hello! I am a student working towards a CIS
CIS degree, I'm only in my second term, so I have a
long way to go still. Next term (starts in November)
I'll be starting my first language (Java) so I
figured this is a good spot to register and get
acquainted with all of you.
Anyway, right now I'm in a programming logic andThink of an array as a series of boxes. These boxes store data for three
elements. So you would have three boxes that store one element of data.
So 'this' array has a capacity of three. If you want something bigger,
you'd create a array with more boxes, say 10. Then your array has a capacity of 10.
To get to anything from a array, you either need to :
a) go through all the elements of the array
b) or actually know the element you want to retrieve.
The second case is simple enough, you usually just specify the element you want. For example the first element would be zero.(counting starts from zero). The last element would be 9 (10 -1).
The first case requires some knowledge of looping, you'd generally itterate from the first until the last element of the array, in each and every element that you are at, do the stuff you need to do. This will go on until the end of the array is reached.
for(int i=0; i<=arraylength;i++ ) {
do some stuff. like print out to the console.
I'm not giving you any specific java code because you didn't ask for any and you were doing a course that wasn't language specific. So I figured that may be a simpler explanation(was it?) was in order.
Let me know if you need clarification.
and design class. In this class we use Pseudocode to
get the basic constructs of programming down without
doing anything language specific. I just read the
chapter that introduces Arrays and had a difficult
time following it. Could any of you take a minute
and give me your definition of what exactly an array
is and how it works? Or maybe point me to a link that
might help me? I've got the 'jist' of it, but the
book jumps right into algorithms using arrays without
much explaination as to what they are.
Thanks for any response and for helping a programming
"n00b".
-Rawhide

Similar Messages

  • Very simple and quick question about Arrays

    Hi,
    I have the following code to produce a student grades provessing system. I have got it to store data in the array, i just cant figure out how to add the integers from the row to produce a total. Thats all I want to do create a total from the 6 marks and add a percentage.
    Any help would be greatly appreciated.
    -------------CODE BELOW----------------------
    import java.util.*;
    public class newstudent1_2
    public static void main (String[]args)
    System.out.println ("-----------------------------------------------"); //Decorative border to make the welcome message stand out
    System.out.println (" Welcome to Student Exam Mark Software 1.2"); //Simple welcome message
    System.out.println ("-----------------------------------------------");
    int [][] mark;
    int total_mark;
    int num_students;
    int num_questions = 9;
    Scanner kybd = new Scanner(System.in);
    System.out.println("How many students?");
    num_students =kybd.nextInt();
    mark = new int[num_students][num_questions] ;
    for (int i=0; i<num_students; i++)
    System.out.println("Enter the Students ID");
    String student_id;
    student_id =kybd.next();
    System.out.println("Student "+i);
    for( int j=1; j<num_questions; j++)
    System.out.println("Please enter a mark for question "+j);
    mark[i][j]=kybd.nextInt();
    System.out.print("id mark1 mark2 mark3 mark4 mark5 mark6 mark7 mark8");
    //This section prints the array data into a table
    System.out.println();
    for (int i=0; i<num_students; i++)
    for( int j=0; j<num_questions; j++)
    System.out.print(mark[i][j]+"\t"); //the \t is used to add spaces inbetween the output table
    System.out.println();
    --------------END OF CODE---------------
    Thanks.

    I had to do this same sort of thing for a school assignment but i didnt use an array.
    import java.text.DecimalFormat;
    import TurtleGraphics.KeyboardReader;
    public class grade_avg
         public static void main(String[] args)
              int grade, total = 0, count = 0;
              double avg = 0.0;
              KeyboardReader reader = new KeyboardReader();
              DecimalFormat df = new DecimalFormat("0.00");
         for (;;)
                   grade = reader.readInt("Please enter a grade: ");
              if (grade > 0)
                        total = total + grade;
                        count ++;
              if (grade == 0)
                        avg = total / count;
                        System.out.println("The average is: " + df.format(avg));
                        System.exit(0);
    }output looks like:
    Please enter a grade: 100
    Please enter a grade: 50
    Please enter a grade: 0
    The average is: 75.00

  • Hello and a question about connecting to SAP B1 c#

    Good morning I have been having a few issues trying to connect to a SAP B1 database via c#
    I have installed the SDK but find the documents to be a bit sparse.  Would anyone be able to point me towards a decent example or manual? Thanks.
    I basically need to know exactly how to format the data of an order so I can create a new sales order (via c#)
    Thanks very much
    edit: looking at some posts it seems my sdk is missing many samples it should have?  I downloaded it from the main site so I dont see how this is possible.
    The only sample folder I have is:
    C:\Program Files\SAP\SAP Business One Development Environment\Samples\UsingUDOGeneratedClassSample
    Edited by: snicholls on Mar 15, 2011 11:38 AM

    You seem to have downloaded the B1DE (Business One Development Environment) which is almost like a wrapper that has been created around the standard SDK to make some aspects of development easier.
    Personally, I do not use it but you will see there are many who do use it!
    Either way, the SDK samples and helpfile will come with the Business One SDK - this is included with any B1 installer or patch, in a subfolder called "Packages\SDK". The samples are extremely useful, and the helpfile although not the best is also a great resource.
    If you don't have a patch or installer, you can contact your SAP partner (or if you work for a partner can just ask your IT guy) and install it from there. I would not advise trying to start working the SDK without at least taking a look at the a few of the samples provided with the SDK.
    (PS the SDK will isntall to: C:\Program Files\SAP\SAP Business One SDK by default)

  • I'm looking to buy a new Macbook Pro, and have questions about the Applecare extended warranty?

    I'm looking to buy a new Macbook Pro, and have questions about the Applecare extended warranty? I want to know if the 3 year extended warranty covers what damage. Like water damage, accidental damage, lost or stolen macbook, manufactory defects, or any other kind of damage, maybe be even cosmetic damage. Can anyone help me?

    If you are talking about features of the MBP itself, as long as you are not looking at  the Retina models, then the memory you can upgrade yourself for a lot less than Apple charges, and that does not affect the warranty as Apple considers memory a user permitted upgrade.  Great sources are Crucial and OWC, both are Mac specialists and have on-line videos on how to do the install.
    If the 15" is what you are looking at, a good upgrade is the 7200 rpm hard drive, gives a little better performance over the standard 5400 rpm drive.
    The Hi Res screen is good if you do a lot of graphics work.
    Comparing the 13" amd 15" you will notice the 15" has a second, discrete graphic processor...helps when you get into heavy duty videos, games, graphics...but keep in mind that kicking in the second processor uses a lot of power and will run the battery down faster.
    If you are looking at the Retina models, then keep in mind there are no post-purchase upgrade options...you have to buy with everything you want at the start.
    Just some thoughts.

  • A few questions about Arrays and Array Methods.

    I have 2 dimentional arrays in a number of classes, and I wish to pass them about as variables, however, I can only seem to send int[], rather than int[][]. Gives me some compile errors.
    Another thing. How do i get the length of an array?
    I've tried: getLength(object), but it's a 2d array (int[][]), and It's having none of it. How do i get the length of a particular side?

    An object like int[][] only has a single "length", and that is the length of the first dimension. This object is an array that contains arrays of int, and each of those arrays could have a different length. Your 2D array may happen to be rectangular but that isn't a requirement of Java. So you would have to write your own code to find the lengths of the sides. The first side would be theArray.length, the second side would be theArray[0].length, and like that.

  • Question about arrays

    I have a question regarding arrays. I have a contact class and two classes that extend from it a SchoolContact class and FamilyContact class. Right now as my code is I have three diffrernt arrays to hold all the info. Is there a way to store all this info into one array and print out only the School contacts at one time if the user enters that option or print out all the options at one time if the user selects that? my code is below
    //The imports below are for I/O
    import java.util.*;
    import java.io.*;
    // Declare a public class
    public class CodeExample {
         public static void main(String[] args) {
              // Create scanner
              Scanner sc = new Scanner(System.in);
              //Declare array to hold school contact
              SchoolContact[] schoolContactInfo = new SchoolContact[10];
              FamilyContact[] familyContactInfo = new FamilyContact[10];
              Contact [] contactInfo = new Contact [10];
              // Declare variables
              int menuOption, creditHours, area, prefix, suffix, studentId, studentContactsSoFar = 0, familyContactsSoFar = 0, contactsSoFar = 0;
              double gpa;
              char studentData, familyRelationOption;
              String menuOption2, menuOption3;
              // Get menu to display
              do {
                   System.out.println("-----MENU-----");
                   System.out.println("1) Enter a Student Contact");
                   System.out.println("2) Enter a Family Contact");
                   System.out.println("3) Enter a Contact");
                   System.out.println("4) Display Student Contacts");
                   System.out.println("5) Display Family Contacts");
                   System.out.println("6) Display Contacts");
                   System.out.println("7) Display All Contacts");
                   System.out.println("8) Quit");
                   System.out.println("Selection:");
                   menuOption = sc.nextInt();
                   SchoolContact schoolContact = new SchoolContact();
                   FamilyContact familyContact = new FamilyContact();
                   Contact contact = new Contact();
                   // Implement switch statement to
                   switch (menuOption) {
                   // If user enters 1 to create contact this will be displayed to user
                   case 1:
                        System.out.println("Enter The First Name of The Student");
                        schoolContact.setFirstName(sc.next());     
                        System.out.println("Enter The Last Name of The Student");
                        schoolContact.setLastName(sc.next());
                        System.out.println("Enter the Student ID of this person: 900");
                        schoolContact.setStudentId(Integer.parseInt("900" + sc.next()));
                        System.out.println("G)Enter The GPA For This Student");
                        System.out.println("H)Enter The Number Of Completed Credit Hours");
                        menuOption2 = sc.next().toUpperCase();
                        studentData = menuOption2.charAt(0);
                        // Prompts the user for the next choice
                        if (studentData == 'G') {
                             System.out.println("GPA: ");
                             gpa = sc.nextDouble();
                             //create the Data object
                             Data data = new Data();
                             data.setStudentGPA(gpa);
                             //add it to the contact
                             schoolContact.setData(data);
                             else if (studentData == 'H') {
                                  System.out.println("Hours: ");
                                  creditHours = sc.nextInt();
                                  //create the Data object
                                  Data data = new Data();
                                  data.setStudentCreditHours(creditHours);
                                  //add it to the schoolcontact
                                  schoolContact.setData(data);
                                  else {
                                       System.out.println("Invalid Entry");
                        System.out.println("Enter The Phone Number of This Student");
                        System.out.println("(###)-###-####: ");
                        area = sc.nextInt();
                        prefix = sc.nextInt();
                        suffix = sc.nextInt();
                        //create the phone object
                        Phone_Number studentPhone = new Phone_Number(area, prefix,     suffix);
                        //add it to the Schoolcontact
                        schoolContact.setPhone(studentPhone);
                        //store info in an array
                        schoolContactInfo[ studentContactsSoFar ] = schoolContact;
                        //increase the counter to point to the next free location (if any)
                        studentContactsSoFar++;
                        break;
                   case 2:
                        System.out.println("Enter the First Name of The Contact");
                        familyContact.setFirstName(sc.next());     
                        System.out.println("Enter The Last Name of The Student");
                        familyContact.setLastName(sc.next());
                        System.out.println("Enter The Relationship of This Contact");
                        System.out.println("A) SISTER");
                        System.out.println("B) BROTHER");
                        System.out.println("C) MOTHER");
                        System.out.println("D) FATHER");
                        System.out.println("E) OTHER");
                        menuOption3 = sc.next();
                        familyRelationOption = menuOption3.charAt(0);
                        if (familyRelationOption == 'A') {
                             System.out.println("Relationship: SISTER ");
                             familyContact.setRelationType(FamilyContact.RelationType.SISTER);
                             else if (familyRelationOption == 'B') {
                             System.out.println("Relationship: BROTHER ");
                             familyContact.setRelationType(FamilyContact.RelationType.BROTHER);
                                  else if (familyRelationOption == 'C') {
                                       System.out.println("Relationship: MOTHER ");
                                       familyContact.setRelationType(FamilyContact.RelationType.MOTHER);
                                       else if (familyRelationOption == 'D') {
                                            System.out.println("Relationship: FATHER ");
                                            familyContact.setRelationType(FamilyContact.RelationType.FATHER);
                                            else if (familyRelationOption == 'E') {
                                                 System.out.println("Relationship: OTHER ");
                                                 familyContact.setRelationType(FamilyContact.RelationType.OTHER);
                        System.out.println("Enter The Phone Number of This Contact");
                        System.out.println("(###)-###-####: ");
                        area = sc.nextInt();
                        prefix = sc.nextInt();
                        suffix = sc.nextInt();
                        //create the phone object
                        Phone_Number familyContactNumber = new Phone_Number(area, prefix,     suffix);
                        //add it to the familyContact
                        familyContact.setPhone(familyContactNumber);
                        //store info in an array
                        familyContactInfo[ familyContactsSoFar ] = familyContact;
                        //increase the counter to point to the next free location (if any)
                        familyContactsSoFar++;
                        break;
                   case 3:
                        System.out.println("Enter The First Name of The Contact");
                        contact.setFirstName(sc.next());     
                        System.out.println("Enter The Last Name of The Contact");
                        contact.setLastName(sc.next());
                        System.out.println("Enter The Phone Number of This Contact");
                        System.out.println("(###)-###-####: ");
                        area = sc.nextInt();
                        prefix = sc.nextInt();
                        suffix = sc.nextInt();
                        //create the phone object
                        Phone_Number contactNumber = new Phone_Number(area, prefix,     suffix);
                        //add it to the contact
                        contact.setPhone(contactNumber);
                        //store info in an array
                        contactInfo[ contactsSoFar ] = contact;
                        //increase the counter to point to the next free location (if any)
                        contactsSoFar++;
                        break;
                   case 4:
                        System.out.println("-----Student Contacts-----");
                        //print each stored contact
                        for( int i = 0 ; i < studentContactsSoFar ; i++ )
                             System.out.println( (i+1) + ". " + schoolContactInfo.toString() + "\n");
                        break;
                   case 5:
                        System.out.println("-----Family Contacts-----");
                        //prints each stored contact
                        for( int i = 0 ; i < familyContactsSoFar ; i++ )
                             System.out.println( (i+1) + ". " + familyContactInfo[i].toString() + "\n");
                        break;
                   case 6:
                        System.out.println("-----Contacts-----");
                        //prints each stored contact
                        for( int i = 0 ; i < contactsSoFar ; i++ )
                             System.out.println( (i+1) + ". " + contactInfo[i].toString() + "\n");
                        break;
                   case 7:
                        System.out.println("Calling Case 7");
                        for( int i = 0 ; i < contactsSoFar ; i++ )
                             System.out.println( (i+1) + ". " + contactInfo[i].toString() + "\n");
                        break;
                   case 8:
                        System.out.println("Program Ended");
                        break;
              } while (menuOption != 8);

    how would I go in printing the contacts from one array, then the next array and so on?
    case 7:
        System.out.println("Calling Case 7");
        for( int i = 0 ; i < studentContactsSoFar ; i++ ) {
            System.out.println( (i+1) + ". " + schoolContactInfo.toString() + "\n");
    for( int i = 0 ; i < familyContactsSoFar ; i++ ) {
    System.out.println( (i+1) + ". " + familyContactInfo[i].toString() + "\n");
    for( int i = 0 ; i < contactsSoFar ; i++ ) {
    System.out.println( (i+1) + ". " + contactInfo[i].toString() + "\n");
    break;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Simple newbie question about arrays..

    Hello all,
    I have two arrays declared like so below the class header:
    String Players[];
    String Final[];
    I have a method like the following:
    public String[] CollectPlayers() {
    Players[0] = new String(txtPlayer1.getString());
    return Players;
    I am calling this method like so
    Final = CollectPlayers();
    Basically not working, giving nullpointerexception, but I feel that I am fundamentally not understanding something, so here is what I want...
    A method that returns an array and (ideally) use this method directly in creating a ChoiceGroup, like this...
    optBull = new ChoiceGroup("Bully", ChoiceGroup.EXCLUSIVE, CollectPlayers(), arrImage);
    Is this possible? Any ideas?
    Thanks in advance
    poncenby

    A few points:
    - You almost never need to call new String(String).
    - You may want to create an ArrayList (dynamic array) and then call toArray(new Players[0]) if you need it to be a fixed array.
    e.g.
    final List players = new ArrayList();
    public List collectPlayers(List players) {
        List finals = new ArrayList();
        for(int i=0;i<players.size();i++) {
            Player player = (Player) players.get(i);
            finals.add(players.getResult());
        return finals;
    players.add(new Player("anne"));
    players.add(new Player("bob"));
    players.add(new Player("fred"));
    List finals = collectPlayers(players);

  • Quick (and urgent) Question about Intel G5's

    Just a quick question about the new intel G5's.
    I currently have bunch of software for my PPC G5 which is a Dual 2ghz. Software includes Adobe CS2, Macromedia Studio, Quark 6, etc, etc.
    If I purchase the new intel mac, would I be able to use the same software? or would I be forced to purchase a whole new set of everything I currently have?
    If the software will work on the intel G5, would it perform at the same rate/better than how it performs now on my PPC g5?
    Thanks in advance for any help.

    Rosetta:
    Most of the time you get a real 'hit' when a program first opens that is PPC. Very sluggish. They will require and use more memory than otherwise, too.
    Tests from last August aren't as helpful, there have been improvements, letting the Mac Pro pull even further ahead.
    http://www.barefeats.com/quad06.html
    Comparison Mac Models shows scores of all models. So there is 2x as much or more processing power, bandwidth, better video, as well as disk drives. A 'base' configuration would be 4-6GB RAM.
    And there are differences, more than between G4 and G5.
    People with experience would be Mac Pro Discussions
    Don't use Migration Assistant, and upgrade to CS3 etc. reinstall all your applications fresh.
    There are some drivers and plug-ins, that can be problems, and known.
    Mac Pro 2GHz 4GB 10K Raptor RAID Cinema HD   Mac OS X (10.4.9)   WD RE RAID Aaxeon FW800 PCIe MDD-G4 APC RS1500 Vista

  • TrackControl, Change Track, and others questions about AvTransmit

    Hi there,
    I've got multiples questions about JMF and AvTransmit, hope you will help
    For a small student project, i'm developing a streaming server using JMF, i have used the AvTransmit example.
    Streaming, etc... everything work fine, i stream music over web
    But i need help with "playlist" :
    // Get the tracks from the processor
    TrackControl[] tracks = processor.getTrackControls();
    First Question :
    The Processor use a MediaLocator to get one track, is there a way to indicate multiples tracks, such as a directory containing multiples audio file ?
    At this time, i can only set 1 file in the MediaLocator.
    I'm using a simple class as Playlist (a File[]), and, when i want to change song, i stop the thread, change the MediaLocator with another file, and restart the thread.
    It works on a Lan, but on Internet, Player (I use VLC for my test) lost the connection, i need to restart VLC to get audio again.
    Second Question
    Is there a more "elegant" way to change tracks ?
    Last Question
    I have think about building my own object Playlist... gasp...
    I've look at the javadoc... but i'm a bit lost... does my class have to implement TrackControl ? what are the object inside etc...
    If someone knows information about this...
    That's all ;)
    Thanks !
    Tommy, french student (sorry for the english)

    First Question :
    The Processor use a MediaLocator to get one track, is there a way to indicate multiples tracks, such as a directory containing multiples audio file ?
    At this time, i can only set 1 file in the MediaLocator.No. The processor uses a MediaLocator to get one file. Files (can) contain multiple tracks.
    You can, in fact, combine the tracks of multiple files together, but, there's no need to do that with your application. AVTransmit2 sends each track as a separate RTP stream, so you'd just be sticking them together just to pull them apart again.
    In general, you want to keep your architecture as one processor per file, one RTP stream per track.
    Second Question
    Is there a more "elegant" way to change tracks ?Yes. It's what I refer to as a jukebox DataSource. I discuss it / explain the concept on this previous thread.
    [http://forums.sun.com/thread.jspa?forumID=28&threadID=5400318]
    What you're essentially doing when you change the MediaLocator is starting over from scratch. You end up with a whole new DataSource, whole new Processor, whole new RTP session. On the LAN, this isn't an issue because it looks like you paused the RTP session (because the IP/PORTs don't change).
    Over the internet, though, when you stop sending and restart, you're very likely going to get a new public NAT port. And so when your stream gets to the client, it's going to look like it's from a different person than the original.
    The solution is to use the jukebox datasource to change the media without restarting the Processor or the RTP streams. That'll ensure that your stream won't move between files from the perspective of the client...
    Last Question
    I have think about building my own object Playlist... gasp...
    I've look at the javadoc... but i'm a bit lost... does my class have to implement TrackControl ? what are the object inside etc...
    If someone knows information about this...Ummmm, your "Playlist" object should just be a Jukebox datasource, so follow the link and figure out how that's supposed to work. If you have questions about it, just ask 'em here (rather than on the older thread)...

  • Documents folder on Desktop and a question about trash

    Hello all. My previous experience has been on Windows PCs, and as a result, I make assumptions and get frustrated on my new Macbook. I was trying to organize some of my files in the Documents folder, and at one point my errant clicking and dragging caused a folder to appear on the desktop for "Documents." Based on my previous experience with Windows, I assumed that folder was a shortcut folder, and because I like my desktop area to be uncluttered and free of icons, I moved it to the trash without thinking anything of it. I continue to organize files in "Documents" under finder as if nothing is amiss. Lo and behold, I go to empty my trash later, and I notice that it is taking some time and says "Deleting 214 of 6517 files" which clues me in to the fact that it is deleting a LOT of things, not just the one or two extraneous short cut icons I thought I had thrown in there. I hit "Stop Emptying Trash" and took a look at the damage. Many of my files in "Documents" got deleted. I moved the "Documents" folder out of the trash and on to the desktop. My questions for anyone kind enough to answer is this:
    1. Is there ANY possible way for me to recover those files? Are they really REALLY gone? If it were Windows, I would know where to look, but because I am new to this OS . . .
    2. What should I have done to remove this darn icon from my desktop? I know its always said that "everything is so intuitive on a mac" but I disagree. Especially when you have moved over from Windows. The contextual menu that comes up when I click on the icon does not allow me to "delete this shortcut." How can I delete this from the desktop but still retain the few files I have remaining?
    Any and all help is appreciated. Have a great day. Thanks - b

    Hi, werty. Welcome to the Discussions.
    By the numbers:
    1. See my "Data Recovery" FAQ for comprehensive advice that may help you with this problem.
    2. Based on what you describe, it sounds like you dragged your Documents folder to the desktop. Generally, the files and folders that appear on one's desktop are actually files and folders within your Home > Desktop folder. By default, your Documents folder is also within your Home folder, at the top level like the Desktop folder, i.e. Home > Documents. You should have moved the Documents folder back to the top level of your Home folder.
    Mac OS X aliases to objects — roughly equivalent to Windows shortcuts to files and folders — are created by dragging an object while holding both the Command and Option keys. See "Mac OS X 10.4 Help: Creating an alias." An alias to an object displays a curved arrow in its lower-left corner — a badge — to differentiate itself from the actual object.
    If you merely drag an object from your Home folder to your desktop, it moves that object from its former folder to the desktop, i.e. the Home > Desktop folder: it does not create an alias to that object unless you also hold Command-Option while dragging.
    Finally, you wrote: "My previous experience has been on Windows PCs, and as a result, I make assumptions and get frustrated on my new Macbook."While Macs are quite intuitive, there are some significant differences between Mac OS X and Windows and an associated learning curve. In some cases, the key to switching is, as Yoda said, that "you must unlearn what you have learned."
    Since you are new to Mac, you will find my "Learning About Mac OS X" FAQ helpful. It lists a number of resources that you will find useful in your transition to Mac including books, online training, switching from Windows, and more.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • A question about arrays (brace yourself this is a long post)

    I am working on an assignment that is about generating a random rabbit race by using arrays:
    Rabbit Race
    Write a program to simulate a race between 4 rabbits (numbered 0 to 3). Initially, all contestants are at the start of the race track (position 0) and must race on a 20 meter track (positions numbered 0 to 19). Each participant has its own technique; some run fast, but are sometimes lazy; while others run slowly but steadily. All rabbits make 1 movement one after the other and the one who arrives at the end of the track before the others, wins the race. Here are the rabbit?s strategies :
    At each turn, rabbit 0:
    - sleeps (so does not run), 50% of the time;
    - runs 4 meters, 30% of the time;
    - runs 3 meters, 20% of the time.
    At every turn, rabbit 1 runs 2 meters.
    At each turn, rabbit 2:
    - sleeps, 30% of the time;
    - runs 3 meters, 70% of the time.
    At each turn, rabbit 3:
    - runs 1 meter, 80% of the time;
    - runs 10 meters, 20% of the time.
    The difficulty in the race is that the track has little slippery hills. So after each movement, rabbits can slide down a hill bringing them either closer to the finishing line, or closer to the starting line. How much they slide and in what direction depends on the slope of the hill at their current position, and how many meters they ran during this turn. Each position (or meter) of the hill has a slope represented by an integer between -3 and +2. If the slope is :
    - zero : then, there is no hill at this position and rabbits that reach this position stay there.
    - a negative integer : then, there is a declining side of a hill at this position, and all rabbits reaching this position will slide down
    to a new position that is closer to the finishing line. The new position will be the current position minus the slope times the number of meters the rabbit ran.
    For example, assume a rabbit was in position 10, then ran 5 meters to position 15. If the slope at position 15 is -2, then the new position of the rabbit will be 15 - (-2 x 5) = 25.
    - a positive integer : then, there is a rising side of hill at that position, and all rabbits reaching this position will slide down to a new position that is closer to the starting line. The new position will be the current position minus the slope times the number of meters the rabbit ran.
    For example, assume a rabbit was in position 10, then ran 5 meters to position 15. If the slope at position 15 is +1, then the new position of the rabbit will be 15 - (+1 x 5) = 10.
    Notes on the race:
    - Rabbits have 40 turns to reach the finish line. If after 40 turns no one has managed to reach position 19 (or beyond), then the race is cancelled and no winner is declared.
    - A rabbit?s position can never go below 0. If, after calculating a rabbit?s position, you arrive at a negative position (ex. position -3), then consider that it is at position 0.
    - Consider that any position outside the track (ex. position 0 or position 20) has a slope of 0.
    - If a rabbit reaches position 19 (or goes beyond it), it does not immediately win the race. If any other rabbit reaches position 19 (or beyond) during the same turn, then there is a tie.
    - If at the same turn, one rabbit reaches position 19, and another reaches a position higher than 19, the second rabbit does not win the race because it went further than the first. They both win.
    Ok I know this is long and boring to read but I already completed the majority of the assignment here is my code:
    public class Assignment_3 {
        public static void main (String args[])
             int[] position = new int[20];
             int[] slope = new int[20];
             int[] moveRabbit = new int[4];
                   moveRabbit[1] = 2;
             int[] currentPosition = new int[4];
             int currentPositionandSlope = 0;
             for (int i=0;i<position.length;i++)
             {     position=i;
              System.out.print(position[i] + " ");
         System.out.println();
         for (int i=0;i<(position.length-5);i++)
         {     slope[i]=(int) (-3 + Math.random()*5);
         for (int i=0;i<position.length;i++)
              System.out.print(slope[i] + " ");
         System.out.println();
         for (int turn=1;turn<=40;turn++)
              int randomNb0 = (int) (Math.random () * 100);
    int randomNb2 = (int) (Math.random () * 100);
    int randomNb3 = (int) (Math.random () * 100);
              if (randomNb0<=50)
                   moveRabbit[0] = 0;
              else if (randomNb<=30)
                   moveRabbit[0] = 4;
              else
              moveRabbit[0] = 3;
              if (randomNb2<=30)
                   moveRabbit[2] = 0;
              else
              moveRabbit[2] = 3;
              if (randomNb3<=80)
                   moveRabbit[3] = 1;
                   else
              moveRabbit[3] = 10;
    for (int j=0;j<=3;j++)           
    System.out.println ("Rabbit" + j + " is at position " + position[currentPosition[j]]);
    if (slope[currentPosition[j]+moveRabbit[i]] < 0)
         currentPositionandSlope = position[currentPosition[j]+moveRabbit[j]] - (slope[currentPosition[j]+moveRabbit[j]] * moveRabbit[j]);
    else if (slope[currentPosition[j]+moveRabbit[i]] > 0)
         currentPositionandSlope = position[currentPosition[j]+moveRabbit[j]] - (slope[currentPosition[j]+moveRabbit[j]] * moveRabbit[j]);
    else
         currentPositionandSlope = (currentPosition[j]+moveRabbit[j]);
    System.out.println ("it will move by " + moveRabbit[j] + ", but at position " + (position[currentPosition[j]] + moveRabbit[j]) + " there is a slope of " + slope[currentPosition[j] + moveRabbit[j]]);
    System.out.println ("so it will slip by " + (position[currentPositionandSlope] - moveRabbit[j]) + " positions, and end up at position " + position[currentPositionandSlope]);
    currentPosition[j] += currentPositionandSlope;
    *Ok basically my question is that in the assignment there is an example output where the rabbit is at position 21 but the array is only 20 in length and my program crashes if i go beyond the array length.*
    The example output is here:
    Welcome to the 4 rabbit race:
    position: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
    slopes: 0 0 1 -2 1 0 -1 -1 1 -2 1 0 -1 -1 1 0 0 0 0 0
    TURN #1
    rabbit 0 is at position 0
    it will move by 3, but at position 3 there is a slope of -2
    so it will slip by 6 positions, and end up at position 9
    rabbit 1 is at position 0
    it will move by 2, but at position 2 there is a slope of 1
    so it will slip by -2 positions, and end up at position 0
    rabbit 2 is at position 0
    it will move by 3, but at position 3 there is a slope of -2
    so it will slip by 6 positions, and end up at position 9
    rabbit 3 is at position 0
    it will move by 1, but at position 1 there is a slope of 0
    so it will slip by 0 positions, and end up at position 1
    TURN #2
    rabbit 0 is at position 9
    it will move by 0, but at position 9 there is a slope of -2
    so it will slip by 0 positions, and end up at position 9
    rabbit 1 is at position 0
    it will move by 2, but at position 2 there is a slope of 1
    so it will slip by -2 positions, and end up at position 0
    rabbit 2 is at position 9
    it will move by 3, but at position 12 there is a slope of -1
    so it will slip by 3 positions, and end up at position 15
    rabbit 3 is at position 1
    it will move by 1, but at position 2 there is a slope of 1
    so it will slip by -1 positions, and end up at position 1
    TURN #3
    rabbit 0 is at position 9
    it will move by 3, but at position 12 there is a slope of -1
    so it will slip by 3 positions, and end up at position 15
    rabbit 1 is at position 0
    it will move by 2, but at position 2 there is a slope of 1
    so it will slip by -2 positions, and end up at position 0
    rabbit 2 is at position 15
    it will move by 3, but at position 18 there is a slope of 0
    so it will slip by 0 positions, and end up at position 18
    rabbit 3 is at position 1
    3
    it will move by 10, but at position 11 there is a slope of 0
    so it will slip by 0 positions, and end up at position 11
    TURN #4
    rabbit 0 is at position 15
    it will move by 0, but at position 15 there is a slope of 0
    so it will slip by 0 positions, and end up at position 15
    rabbit 1 is at position 0
    it will move by 2, but at position 2 there is a slope of 1
    so it will slip by -2 positions, and end up at position 0
    *rabbit 2 is at position 18*
    *it will move by 3, but at position 21 there is a slope of 0*
    *so it will slip by 0 positions, and end up at position 21*
    *We have a potential winner...*
    rabbit 3 is at position 11
    it will move by 1, but at position 12 there is a slope of -1
    so it will slip by 1 positions, and end up at position 13
    So yeah :) that's basically my question (all this text for a simple question like that lol)
    If you've managed to get to the end of my post then any guidance on my code would be appreciated too :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I'm not going to read that long post. As suggested, produce an SSCCE
    and paste in the exact, complete error message, and indicate clearly which line causes it.
    I did notice this though:
    Ok basically my question is that in the assignment there is an example output where the rabbit
    is at position 21 but the array is only 20 in length and my program crashes if i go beyond the array length.Either you're misunderstanding something, or the assignment has a typo. If you have an array of length 20, then the indices are 0..19.
    Maybe the instructor is calling index 0 position 1--separating Java's array impelementation details from
    colloquial 1-based counting, so that the rabbit starts at "position 1" (index 0) goes through "position 20"
    (index 19), and when he's done, he's "at postion 21"--i.e., past the finish line, off the end of the course, etc.
    This won't correspond to any index in the array, but can still be considered a logical position in the race. "Oh, he's
    at position 21. He's done. There's nothing more to do with the array, as it has no slot corresponding to
    this 'done' position."
    That's pure speculation on my part. You'll have to ask your instructor or figure out for yourself what's going on.

  • New to mac and iphoto, questions about photo structure & organization

    I bought a new Macbook Pro a couple of days ago and am still figuring things out. I wasn't displeased with windows...I just decided to try a mac anyway, So far, I adore it except for one thing, the pictures.
    I spent hours researching whether to download and use picasa 3 for mac or iphoto. I decided on picasa....and now I've changed my mind. (Mostly because I tried to take pictures of the moon tonight, and they looked great in camera, but Picasa could only pick up a black screen whearas iphoto actually saw and defined the moon- and with the editing software on the two, the picasa auto-edit looked like a picture that was created in microsoft paint, and iphoto came out with a beautifully contrasted photo).
    Now that I decided to use iphoto, I have been researching how to switch and still seem to have a lot of questions. (I've poked around numerous forums but have found conflicting answers on different sites).
    1) I organize my pictures by folders with the month and year. I know iphoto organizes events, which it seems to determine based on photo similarity. Will my photo structure still appear in finder -> pictures?
    2) Is it possible to stop iphoto from organizing my pictures and just trust me on what I want?
    3) All of my friends and family use PCs, and there is a chance that due to financial concerns, when I eventually replace my macbook pro (far in the future) I could switch to a pc. Does iphoto make transferring pictures more difficult? (If I understand correctly, it does not change the photo file, a jpeg is still a jpeg but I want to be sure)
    4) I do not want iphoto to duplicate all of the pictures already in my library....if I import from finder-users-pictures, will it simply use those, or duplicate all 150gb worth of pictures?
    5) Any other tips for someone completely new to macs and iphoto?
    6) This is very silly, but how do I uninstall picasa (I know how to uninstall on a windows but want to make sure I do things correctly on my mac!)
    Also, just a "bonus"- regarding events vs. files I create, will iphoto create events within the program but leave my file structure in the library it imports from alone? If I use finder to go to where I store my photos, will I still see my file structure regardless of what iphoto does?(Does that make sense? I'm having a hard time trying to describe it)
    I apologize if this question is foolish or misplaced- I did read many other posts but didn't see the answers I was looking for.

    Your questions are neither foolish nor misplaced.
    The first thing I strongly suggest is that you make a trial iPhoto Library. Import 100 or 200 pics and explore. Iphoto isn't right for everybody, and if you're going to use it you will need to rethink things a little.
    1) I organize my pictures by folders with the month and year. I know iphoto organizes events, which it seems to determine based on photo similarity. Will my photo structure still appear in finder -> pictures?
    A: Events are based entirely on Date and Time not on 'photo similarity' You can set the interval for what makes an Event in the iPhoto Preferences: iPhoto Menu -> Preferences -> General Pane: Autosplit into Events... And select from the drop down menu.
    Will my photo structure still appear in finder -> pictures?
    Yes or no, depending... iPhoto can run as a Referenced or Managed Library. In the former case, yes you files will be visible in the Finder, in the latter case they won't.
    Note that Referenced or Managed refers +only to file storage+ It offers no extra functionality, it does nothing at all. App like iPhoto are your go-to app for your photos. If you use it, then you never access the photos via the Finder. Ever. It's always via iPhoto or the many, many hooks into the OS that it has.
    I'll detail more on Referenced v Managed below.
    2) Is it possible to stop iphoto from organizing my pictures and just trust me on what I want?
    I'm not sure what you mean by this. Iphoto does basic date and time organisation by default. You can change it, you can change the location of the photos in Events, merge them and then using the other tools available - Albums, Smart Albums, Faces, Places etc you can organise your photos whatever way you want.
    But what do you mean by pictures. There is a distinction between Photos - the image of your child holding his dog - and files: A Jpeg is just a file. Iphoto is designed for you to +forget about the jpeg+ and get on with the interesting bit: the pics of your younger and his pet.
    3) All of my friends and family use PCs, and there is a chance that due to financial concerns, when I eventually replace my macbook pro (far in the future) I could switch to a pc. Does iphoto make transferring pictures more difficult? (If I understand correctly, it does not change the photo file, a jpeg is still a jpeg but I want to be sure)
    A Jpeg is a Jpeg is a Jpeg. If you migrate to another app or an entire OS you can export the photos plus any and all metadata you've added to the Finder and move it on. (Caveat: You cannot export Faces. There is no agreed standard on any system for exchanging this info.)
    4) I do not want iphoto to duplicate all of the pictures already in my library....if I import from finder-users-pictures, will it simply use those, or duplicate all 150gb worth of pictures?
    It can do either. And this brings me back to the Referenced v Managed discussion above. By default, iPhoto will Manage the files, that is, it will copy them into the Library. You can choose not to, but I strongly recommend that you don't:
    *How to do it:*
    Simply go to iPhoto Menu -> Preferences -> Advanced and uncheck 'Copy Files to the iPhoto Library on Import'.
    *What Happens:*
    Now iPhoto will not copy the files, but rather simply reference them on your HD. To do this it will create an alias in the Originals Folder that points to your file. It will still create a thumbnail and, if you modify the pics, a Modified version within the iPhoto Library Folder.
    *Some things to consider:*
    1. Importing and deleting pics are more complex procedures. You have to to put the files where they will be stored before importing them. When you delete them you'll need to remove the files from the HD yourself.
    2. You cannot move or rename the files on your system or iPhoto will lose track of them on systems prior to 10.5 and iPhoto 08. Even with the later versions issues can still arise if you move the referenced files to new volumes or between volumes.
    3. Most importantly, migrating to a new disk or computer can be much more complex.
    4. Because iPhoto has no tools for managing Referenced Files, if, for some reason, the path to the photos changes then you could find yourself resolving aliases for +each photo in the Library+ one by one.
    My own opinion:
    I've yet to see a good reason to run iPhoto in referenced mode unless you're using two photo organisers
    If disk space is an issue, you can run an entire iPhoto Library from an external disk:
    1. Quit iPhoto
    2. Copy the iPhoto Library as an entity from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    If you're concerned about accessing the files, There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and later* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and later:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    *If you want to edit the photo in another application:*
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    5) Any other tips for someone completely new to macs and iphoto?
    *To Push Home a point*
    For someone inexperienced with Macs and inexperienced with iPhoto I cannot stress enough that Managed Library is the way to go. I understand there is comfort in seeing all those folders. But inside the Library that's all there is: all those folders, stored so that an inexperienced user can't grub things up!
    The iPhoto Library Folder is a Package File. This is simply a folder that looks like a file in the Finder. The change was made to the format of the iPhoto library because many users were inadvertently corrupting their library by browsing through it with other software or making changes in it themselves. Want to see inside?
    Go to your Pictures Folder and find the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed.
    Standard Warning: Don't change anything in the iPhoto Library Folder via the Finder or any other application. iPhoto depends on the structure as well as the contents of this folder. Moving things, renaming things or otherwise making changes will prevent iPhoto from working and could even cause you to damage or lose your photos.
    Now close that window and forget about it.
    So, once you've imported your photos to iPhoto in a Managed Library, the surplus duplicates are +your folders+. Of course, in time, trash them to get back the wasted disk space. But don't do it today or tomorrow. There's no hurry. When you feel confident that you understand how iPhoto is working and that's it's working for you, theat's the time to reclaim the space.
    I organize my pictures by folders with the month and year.
    If you want to duplicate your Folder Tree in iPhoto:
    Start at the bottom of the hierarchy and drag a folder of images to the Album Heading in iPhoto. The pics will be imported and an Album of the same name created.
    You can then create the Enclosing Folders in the iPhoto Window (File -> New Folder) and drag the Album to it. Folders can contain other Folders (Nested Folders) and Albums.
    However, is your folder system date based? Then this form of organisation is a bit pointless in iPhoto when Smart Albums or the Calendar tool (Click on the wee magnifying glass in the Search Box) mean you can find the photos taken on any day, month or year at a click. With Smart Albums it's easy to find photos from specific range - say, June 3 to August 25, 2009 etc.
    If your folder system is theme based - Xmas pics, Birthday pics etc, then you'll find Keywords are much more flexible, and can be used in conjunction with other criteria for making Smart Albums and searches.
    6) This is very silly, but how do I uninstall picasa (I know how to uninstall on a windows but want to make sure I do things correctly on my mac!)
    Drag the app to the trash and empty it.
    Regards
    TD
    v

  • ILife 08 to 09 iWeb question (and a question about DW while I'm here)

    I was thinking of upgrading to iLife 09 for just a couple of reasons:
    (1) The iPhoto face recognition feature looks cool and I want to try it. I have tens of thousands of photos of friends from nearly 30 years in my iPhoto and it might be fun.
    (2) I basically like iWeb 08, but hate the way it deals with multiple sites. I always have to publish everything, but in iWeb 09 it looks like I can single out just a single site for publishing, even via FTP. is that right?
    Recently I also acquired Dreamweaver because of some work I'm doing for a company. But I find I can't even do basic simple things, like drag around text or insert a web widget (some HTML in a box) to move around and position - like I can do in iWeb.
    Are things like that possible in Dreamweaver?
    I can't even figure out how to add new text somewhere on a blank page in Dreamweaver. And everything I create looks boxy, plain and clunky. I am obviously not a web designer - I am a web application programmer.
    With Dreamweaver I feel like I stepped into some 20th century web authoring tool. With iWeb everything I create looks nice even though I have no artistic talent myself.
    doug

    I don't mind publishing to a folder and uploading using my FTP client, but it seems I have to publish ALL the sites each time to the folder and then just upload the one site's folder I was editing. So it takes a long time each time I publish to the folder. There is no way around that, is there?
    About my DW question, it was "in comparison to iWeb". If I asked in a Dreamweaver forum if DW could do this thing that iWeb could do, somebody would probably say, "Why don;t you ask your question on an iWeb forum?"
    Thanks,
    doug@hoping this discussion doesn't digress into whether I should post my question here or not

  • Verizon iPhone - mobile hotspot and other questions about the data options

    I just ordered the Verizon iPhone. Can anyone explain the options here:
    1) Unlimited corporate email & Web (business and personal email) vs. Unlimited email and web for smartphones (personal email) - what's the difference?
    2) "3G Mobile Hotspot 2GB" - does this mean that there's no way I can share my 3G connection via wifi without paying the extra $20/month?? How about tethering to a single computer (USB, BT, or WiFi) - does that also require this extra option?
    3) equipment protection - what's the difference between Extended Warranty, Asurion Wireless Phone Protection, and Total Equipment Coverage?
    thanks in advance,
    Mike

    Hi
    Regarding your #2 question; yes, you must pay $20/mo to use the 3G Hotspot aspect of the iPhone, same as with any of Verizon's phones that offer this feature such as the Droid X, HTC phones, etc. And, there is NO additional charge to tether it to your computer; it's $20/mo regardless. You can still use the iPhone's WiFi feature to search the web which is part of the regular data plan. We're only talking about paying the $20/mo for the "up to 5 devices" jumping on your phone as a hot spot.
    I'm an Apple fan, have my MacBook Pro, but my phone is a Droid X. I've been a Verizon member since a year before they became Verizon. Additionally, I am part of the Verizon & Motorola test forum; testing new software updates as they come along.
    Something you should know about Verizon's 3G Hot Spot feature; it has issues. Those of us in the Motorola & HTC forums have experienced identical issues with regard to the 3G Hot Spot feature; it disconnects every 2 minutes, even when you are actively surfing the net. Verizon & Motorola Support have been very helpful to provide what they believe are fixes, including: changing the channel, hard resets, clearing cache, etc. It does not work. Most of us believe, this is NOT a Verizon issue, but a phone maker issue.
    I also have Verizon's MiFi 2200. It costs $59/mo and is purely a hot spot device; again up to 5 devices. I use it at home, for my lap top and for those who need connectivity. It outperforms the 3G hot spot feature of the Motorola & HTC phones by leaps & bounds, and I suspect it will out perform the 3G hot spot feature on the iPhone. Additionally, you get 5GB of download with the MiFi which Verizon is planning on offering increases to 8GB & 10GB. There is NO plan to increase the 2GB download limitation on the 3G Hot spot of the iPhone & other phones, and anyone who does basic software downloads & pics, knows 2GBS is not a lot space.
    So, I would recommend not paying the $20 until this is resolved. If you do, you could pay $39 more for a total of $59/mo for the MiFi, download the software to you home computer & notebook, and end up canceling your home internet service. I did this and have saved $70/mo in my total utilities.
    One other important note: Verizon's VZManager Software for their phones & MiFi. If you did pay the $20/mo for the iPhone and decided to tether to your USB port (for power while using) and you were to use the 3G hot spot feature, it will NOT work on 64 Bit computers, regardless if you are using the WiFi feature or directly using VZManager. The MiFi has this same issue. It will only work on 32 Bit when tethered. So, you'd have to reboot your computer to 32 Bit, if you have that ability. On a Macbook Pro, simply restart holding down the "3" & "2" keys.
    I have no idea why Verizon can't simply upgrade the firmware, even recent firmware upgrades have not resolved this. Most new computers are 64 Bit now.
    Despite this, I use my MiFi 100% untethered and carry my charge cord in my bag as it also works on my Droid, and I presume they may do the same for the iPhone; reduces the need for multiple power cords.
    I really looked forward to the 3G feature of the Motorola & HTC phones, but honestly, it's just not there yet; mine was slower than Dial Up, and I'm not kidding.

  • Default values and other questions about MIO-PCI-16E-1

    Hi, I have a few questions involving the above mentioned board.
    First: When doing a data acquisition using an external digital trigger and an external clock, which edge of the clock signal is read by default?
    What is the delay between a STARTSCAN signal being received and a CONVERT signal being generated (signifying an ADC convertion taking place?)
    Finally, what exactly is the sample interval counter? What does it do? This is mentioned on page 4-32 in the E Series DAQ user manual.
    Hopefully these questions aren't too stupid We're designing some custom circuitry to work with the DAQ, and for things to work the timing must be precise. We need ALL the timing details about a single data acquisition t
    hat we can get.
    The system we're running on has Labview 6.0.2, and we are only acquiring data from one analog input.
    Thanks a ton!
    --Randall Cameron

    Hey Randall,
    The internal Scan Clock is a rising edge clock, if you are interested in having the rising edge clock output as high until a scan is complete, please refer here. The internal Convert Clock is always falling edge clock.
    If you are using an external signal, you can specify the polarity of the signal by selecting PFI pin, high to low, or low to high, if you are using the Clock Config VI. The method for setting the polarity changes based on the method of programming the card. And again, I do not know what the digital trigger defaults to, but you can select either polarity.
    The delay between a Scan and a Convert is based on the Convert Clock.
    Ideally, the delay is in the nanosecond range, and then the Convert Clock determines the spacing between any further samples.
    As for the sample interval counter, the following is pasted from page 4-35.
    �The sample interval counter on the PCI E Series device normally generates
    the CONVERT* signal unless you select some external source. The counter
    is started by the STARTSCAN signal and continues to count down and
    reload itself until the scan is finished. It then reloads itself in preparation for
    the next STARTSCAN pulse.�
    So just let us know if you have any questions on getting the polarity set up, or if anything is not fully explained.
    Best regards,
    Justin T.
    National Instruments

Maybe you are looking for

  • Printer won't print despite installation apparently okay

    I have an HP Deskjet F380 All-in-One.  I know it's old but it's all I can afford.  I'm running Vista Home Basic.  Again, i know it's old but ... A long time ago it began re-installing itself every time I used it.  This was fixed and it's only recentl

  • Java Applets in Safari

    I'm trying to run a Java applet with safari, but everytime I go to the webpage all I get is a grey box with a picture of a coffee cup that has two arrows circling it. Nothing loads after that. Any idea how to fix this?

  • Mega pc 865 runnig ubuntu linux

    i've just instaled ubuntu linux on my mega pc 865. everything seems to be working properly... the only (big) problem is the fan noise. when i boot windows xp, the fan noise always reduces into an acceptable minimum. but that doesn't happen when i boo

  • Workflow email PDF attachment

    All, I'm using the following code in a zprogram/FM that will be called in a method to create an attachment to the workflow and then send the attachment through mail. But this is not working. 1) I trigger the wf thru idoc posting - works fine 2) The i

  • Opinions on fastest systems

    I want to see how this turns out! OK....you can buy Intel's up to 3.8Ghz and AMD's up to 2.8Ghz so there is a very big difference between the two. Now....you can buy different makes and models of MB's some with no OCing abilities and some made just f