Only looking at the first entry

i have some code which checks a certain payroll number of an employee
for some reason - no matter how many employees i add to the TreeSet it only tells me that the first employee added exists
so if i add an employee number 121 and 123
it will say that employee number 123 is not found if i tell it to find that particular employee
if i say 121 - it tells me it DOES exist
whats going on?
       Iterator iter = theStaff.iterator();
        while(iter.hasNext())
             Employee employee = (Employee)iter.next();
             if(payrollNumber == employee.getPayrollNumber())
                  found = true;
                  ConsoleIO.out.println("employee found");
                  theMessage = "Payroll Number found = Employee exists";
             else
                  found = false;
                                          ConsoleIO.out.println("no employee found");
                  theMessage = "Payroll Number not found = Employee doesnt exist";

lol
yeh nearly just doing the gui - having a little problem with it but i think i got most of it covered :)
many thanks once again for all your valuable help :)

Similar Messages

  • Events over multiple days only show on the first day in 'Month' view

    Hi,
    I've noticed that if I create an event that spans over two days (for example 23 May 2008 at 6 PM to 24 May 2008 at 1 PM) are only displayed on the from date in Month view.
    This is unfortunate because if I look at my calendar in Month view, I think I'm free on the 24th, when in fact I'm busy until 1 PM.
    Is there a way to get the Month view to display an entry for the event on both days (other than creating one event running from 23 May 2008 at 6 PM to 11:59 PM and a second from 24 May 2008 at 1:01 AM to 1 PM)?
    Message was edited by: Sam Watterson

    Hi Sam
    I just had the exact same problem the other day. I was asked to make an appointment with someone, I checked my calendar (actually on my iPhone) and I looked available that day so agreed and even entered the event. Turns out I will be working 70 miles away on the event I entered on the day prior. I've had the embarrassment of having to reschedule - makes me look disorganised.
    The month view on iPhone is just the same as iCal - if it's not an 'all day' event it only shows on the first day. This is poor. I recall even outlook and windows mobile calendar manages to display this sensibly. Apple should be fixing this pronto.

  • A question about piecewise insert(OCI), only data in the first piece ..

    When i do a piecewise insert operation, only data in the first piece was inserted into the column, There is no error occured. a OCI_SUCCESS returned when the last piece operation completed.
    I am really puzzled now:(.
    Who can get me out of this?
    The data to be insert are stored in many structs:
    typedef struct test_st{
         char * buffer;
         struct test_st * next;
    } TEST_ST;
    I use malloc(size) to allocate the buffer of each struct, and I use strcpy() to copy some strings to these buffers.
    table mc_test is like this:
    id number;
    message varchar(64);
    The full source_code goes there:
    #include <stdio.h>
    #include <unistd.h>
    #include <stdlib.h>
    #include <oci.h>
    static OCIEnv *p_env;
    static OCIError *p_err;
    static OCISvcCtx *p_svc;
    static OCIStmt *p_sql;
    static OCIDefine p_dfn    = (OCIDefine ) 0;
    static OCIBind p_bnd    = (OCIBind ) 0;
    const char * orausername="out_user";
    const char * orapassword="user_out";
    const char * oraserver="bigfish";
    int oraOK=0;
    int rc;
    char errbuf[100];
    int errcode;
    int checkerr(OCIError *errhp, sword status);
    int db_init(void);
    int db_open(void);
    int db_close(void);
    typedef struct test_st{
         char * buffer;
         struct test_st * next;
    } TEST_ST;
    int db_save_to_test(){
         char               sql_str[512];
         ub4                    typep;
         ub4                    piec_status;
         ub1                    in_outp;
         ub4                    rownum;
         ub4                    arr;
         sb2                    indp;
         ub2                    r_code;
         int                    t_buff_len;
         int                    total_len=15;
         int                    buffer_pos=0;
         TEST_ST * content, * t;
         content=(TEST_ST *) malloc(sizeof(TEST_ST));
         content->buffer= (char *) malloc(5);
         strcpy(content->buffer,"1234");
         content->next=(TEST_ST *) malloc(sizeof(TEST_ST));
         content->next->buffer= (char *) malloc(5);
         strcpy(content->next->buffer,"5678");
         content->next->next=(TEST_ST *) malloc(sizeof(TEST_ST));
         content->next->next->buffer= (char *) malloc(5);
         strcpy(content->next->next->buffer,"9012");
         content->next->next->next=NULL;
         if(!_ora_OK){
              return 0;
         printf("-------------------------\n");
         printf("[db]save to mc_test..\n");
         printf("total: %d bytes\n",total_len);
         /* create sql */
         sprintf(sql_str,"insert into mc_test(id,message)values(1,:x)");
         //printf("%s\n",sql_str);
         rc = OCIStmtPrepare(p_sql, p_err, sql_str,
              (ub4) strlen(sql_str), (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT);
         checkerr(p_err,rc);
         rc = OCIBindByPos(p_sql, &p_bnd, p_err, (ub4) 1,
                   (dvoid *) content->buffer, total_len, SQLT_CHR, (dvoid *) 0,
                   (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DATA_AT_EXEC);
         checkerr(p_err,rc);
         rc = OCIStmtExecute(p_svc, p_sql, p_err, (ub4) 1, (ub4) 0,
              (CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT);
         checkerr(p_err,rc);
         if(rc == OCI_NEED_DATA){
              printf("[pw] start........\n");
              // insert next pieces
              t=content;
              printf("%d bytes total.\n",total_len);
              while(t!=NULL){
                   if(t==content){
                        piec_status=OCI_FIRST_PIECE;
                        t_buff_len=strlen(t->buffer);
                        buffer_pos=t_buff_len+1;
                        printf("ready for first piece: %d bytes\n",t_buff_len+1);
                        printf("__________________\n%s\n__________________\n",t->buffer);
                   }else if(t->next==NULL){
                        piec_status=OCI_LAST_PIECE;
                        t_buff_len=strlen(t->buffer);
                        buffer_pos+=t_buff_len+1;
                        printf("ready for last piece: %d bytes\n",t_buff_len+1);
                        printf("__________________\n%s\n__________________\n",t->buffer);
                   }else{
                        piec_status=OCI_NEXT_PIECE;
                        t_buff_len=strlen(t->buffer);
                        buffer_pos+=t_buff_len+1;
                        printf("ready for next piece: %d bytes\n",t_buff_len+1);
                        printf("__________________\n%s\n__________________\n",t->buffer);
                   t_buff_len++;
                   rc = OCIStmtSetPieceInfo((dvoid *)p_bnd,
    (ub4)OCI_HTYPE_BIND, p_err, (dvoid *)t->buffer,
    & t_buff_len, piec_status, (dvoid *) 0, &r_code);
                   checkerr(p_err,rc);
                   rc = OCIStmtExecute(p_svc, p_sql, p_err, (ub4) 1, (ub4) 0,
                        (CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT);
                   checkerr(p_err,rc);
                   t=t->next;
              if(rc==OCI_SUCCESS){
                   printf("All insert OK\n");
              printf("-------------------------\n");
              return 0;
         }else if(rc==OCI_SUCCESS){
              printf("Simple inserted.\n");
              printf("-------------------------\n");
              return 1;
         }else{
              checkerr(p_err,rc);
              printf("-------------------------\n");
              return 0;
    int main(){
         db_init();
         db_open();
         db_save_to_test();
         db_close();
    int db_close(){
         rc = OCILogoff(p_svc, p_err); /* Disconnect */
         rc = OCIHandleFree((dvoid *) p_sql, OCI_HTYPE_STMT); /* Free handles */
         rc = OCIHandleFree((dvoid *) p_svc, OCI_HTYPE_SVCCTX);
         rc = OCIHandleFree((dvoid *) p_err, OCI_HTYPE_ERROR);
         oraOK=0;
         return rc;
    int db_open(){
         /* Connect to database server */
         rc = OCILogon(p_env, p_err, &p_svc, orausername, strlen(_ora_username), orapassword, strlen(_ora_password), oraserver, strlen(_ora_server));
         if (rc != 0) {
         OCIErrorGet((dvoid *)p_err, (ub4) 1, (text *) NULL, &errcode, errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
         printf("Error - %.*s\n", 512, errbuf);
         return(8);
         /* Allocate SQL */
         rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_sql,
              OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0);
         checkerr(p_err,rc);
         oraOK=1;
         return rc;
    int db_init(){
         rc = OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0, /* Initialize OCI */
              (dvoid * (*)(dvoid *, size_t)) 0,
              (dvoid * (*)(dvoid *, dvoid *, size_t))0,
              (void (*)(dvoid *, dvoid *)) 0 );
         /* Initialize evironment */
         rc = OCIEnvInit( (OCIEnv **) &p_env, OCI_DEFAULT, (size_t) 0, (dvoid **) 0 );
         /* Initialize handles */
         rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_err, OCI_HTYPE_ERROR,
              (size_t) 0, (dvoid **) 0);
         rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_svc, OCI_HTYPE_SVCCTX,
              (size_t) 0, (dvoid **) 0);
         checkerr(p_err,rc);
         return rc;
    int checkerr(OCIError *errhp, sword status){
         text errbuf[512];
         sb4 errcode = 0;
         switch(status){
              case     OCI_SUCCESS:
                        return 0; break;
              case     OCI_SUCCESS_WITH_INFO:
                        (void) printf("Error - OCI_SUCCESS_WITH_INFO\n");
                        break;
              case     OCI_NEED_DATA:
                        (void) printf("Error - OCI_NEED_DATA\n");
                        break;
              case     OCI_NO_DATA:
                        (void) printf("Error - OCI_NODATA\n");
                        break;
              case     OCI_ERROR:
                        (void) OCIErrorGet((dvoid *)errhp, (ub4) 1, (text *) NULL, &errcode,
                                       errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
                        (void) printf("Error - %.*s\n", 512, errbuf);
                        break;
              case     OCI_INVALID_HANDLE:
                        (void) printf("Error - OCI_INVALID_HANDLE\n");
                        break;
              case     OCI_STILL_EXECUTING:
                        (void) printf("Error - OCI_STILL_EXECUTE\n");
                        break;
              case     OCI_CONTINUE:
                        (void) printf("Error - OCI_CONTINUE\n");
                        break;
              default:
                        break;
         return 1;
    ref: http://www.oracle.com.cn/onlinedoc/appdev.920/a96584/oci05bnd.htm#427755

    On Windows, the Flash player plugin DLL is under C:\Windows. When everything is working correctly, Firefox finds the Flash player by checking entries under a registry key. I don't know whether this check takes place every time Firefox restarts, or at other intervals.
    Other plugins may install differently, e.g., copying a DLL into a folder under c:\Program Files (x86). It's rare for a plugin to be profile-specific.
    If your plugin list is not updating, the pluginreg.dat file that stores plugin information might be corrupted. This article has a section on how to delete that file so Firefox will regenerate it: [https://support.mozilla.org/en-US/kb/troubleshoot-issues-with-plugins-fix-problems#w_re-initializing-the-plugins-database]. Does that help?

  • SPD Workflow will not start automatically for the first entry in a list on any given day (subsequent entries start just fine)

    Hi. I have various workflows on various lists that share a common issue. The first entry of the day on that list will not start the workflow automatically.   We have SharePoint 2013 Foundation. This same issue occurred when we had SharePoint 2010
    as well. Interestingly, I had read about a 'fix' by adding a 5 minute pause at the start of every workflow which worked fine for a while. Now I happened to find that this is no longer working (after I see a bunch of workflows that didn't fire over the past
    month - ugh!).
    I know I'm not the only one with this issue as I ran across others with the issue when I first researched it and found the 'pause fix' a year or so ago and I also talked with someone else during a SP seminar who used this same fix.  NOTE:  These
    are end users creating the items.  It is not logged as a system account.
    Any help would be appreciated.  I have a SharePoint developer I can hire if this is beyond my ability to fix.  I just need some guidance (last time I inquired they weren't aware of this issue). 

    Can you also advise if these are complicated workflows or high traffic lists?
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Please help me. I've just lost my iphone so I related to my backup contacts on icloud to get my contacts back. But my contacts only show at the first time and then they dissappeared, my contacts was empty. How can I see my contacts?

    Please help me. I've just lost my iphone so I related to my backup contacts on icloud to get my contacts back. But my contacts only show at the first time and then they dissappeared, my contacts was empty. How can I see my contacts?

    If they aren't on icloud.com they are no longer in iCloud.  If you don't have another backup, I'm afraid they're gone.

  • Copying and pasting adjustments.  When I copy the adjustments of an image, I thought I could then select several images and batch paste the adjustments to all selected images. But instead it's only pasting to the first photo of the selection. What am I do

    Copying and pasting adjustments.  When I copy the adjustments of an image, I thought I could then select several images and batch paste the adjustments to all selected images. But instead it's only pasting to the first photo of the selected. What am I doing wrong?

    Copy and Paste develop settings in Develop mode on multiple photos on the film strip works for me, even with Auto-Sync turned off.  Lr5.6 OSx 10.8.5

  • I modified the first business card in a template. Does anyone know how to get the other cards on the template to look like the first one without doing each individually? please and thanks!

    I modified the first business card in a template. Does anyone know how to get the other cards on the template to look like the first one without doing each individually? please and thanks!

    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=182&mforum=iworktips ntrick
    Peter

  • Infopath submit button only works for the first row in a repeating table‏

    Hi, I have a InfoPath Email submit button issue I could not figure out. I have a master/detail repeating table in my form, and one of fields is "EmailAddress" which shows customer's email address. I created a submit button and put the "EmailAddress"
    field to "TO" object. When I tested it, the submit button only would return the first row of emailaddress from the repeating table, but not the rest of it..
    What I want is when I highlighted a customer, and click the submit button, the current customer's email address would show up in "TO" list. I did some research and saw some suggestions about using current() function. So I put current() in the front,
    like this:
    current()/dfs:dataFields/d:vw_HZLeadLists/@EmailAddress
    Still not working..Just return the first record of emailaddress from master repeating table... Does anyone know what's going on here? Thanks a lot!

    Hello,
    Use double eval to get all rows values. See my reply for more information in below thread:
    eval(eval(EmailAddress, 'concat(ToField, ";")'), "..")
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/cc22aeb7-351f-45a7-8a4c-94132c3e0db2/eval-semicolon-function-issue?forum=sharepointcustomizationprevious
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • When I run the cursor over a template it shows several pages but when i select the document it only brings up the first two pages to edit. How do I see them all?

    When I run the cursor over a template it shows several pages but when i select the document it only brings up the first two pages to edit. How do I see them all?

    Skimming the templates in the Template Chooser shows you all of the pages available in the template once you open it. You can insert the one(s) you want, even more than one of any of them. Most users don't want or need all of the different pages, especially when they start the document.

  • Including image in SharePoint survey answer and hiding elements only work on the first page

    Hi All,
    I would like to add some text/remove some text etc on a sharepoint survey page.
       Which i have done using jquery/jscript.
    But unfortunately it only works on the first page.
    Any ideas how i can get it to work on all the pages?
    See a sample here on how you can add the scripts:
        http://sharepointkings.blogspot.com.au/2011/05/include-image-in-sharepoint-survey.html
    Cheers

    Hi Patrick, does the first page use the same ASPX file as the other pages? If not, you will need to add your jquery/jscript to the other page as well.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Pressing "shuffle" on my 7th gen Nano will only randomly pick the first song, then repeats it over and over. How do I get "shuffle to work properly?

    Pressing "shuffle" on my 7th gen Nano will only randomly pick the first song, then repeats it over and over. How do I get "shuffle to work properly?

    Is "REPEAT ONE" highlighted. If it is, touch it to de-select. Cheers!

  • I have a 7 minute MP3 that I want to edit, however when I drag it into garageband it only pulls in the first 3:30.  Any thoughts on why?

    I have a 7 minute MP3 that I want to edit, however when I drag it into garageband it only pulls in the first 3:30.  Any thoughts on why?  At the 3:30 mark in the song there is a pause but then it starts back up but for some reason the program won't pull in the part of the song beyond the pause.   Thanks!

    Hello npatel1207,
    You may need to increase the duration of the project.
    GarageBand '11: Set the project length
    http://support.apple.com/kb/PH1832
    Cheers,
    Allen

  • Select for all entries in table - only interested in the top entry

    Hi gurus,
    I have a general question: We have the task to select entries from a certain database table (that possibly holds millions of entries in the productive environment).
    We also have an internal table at out hands that holds all candiates e.g a material number for which we want to select the data. That table can hold a few hundred entries.
    In this task we are only interested in the 'youngest' entry for a given material - for that we a 'timestamp' in the key fields that should be used.
    The data base table has various other key fields so that we can have multiple entries for each material.
    What is the best/most efficient way to code it?
    One select ?
    Select and sort afterwards etc.?
    Thanks for any coding suggestion!
    CN.

    >
    Siegfried Boes  wrote:
    > [email protected].
    >
    > I think the discussion is to general, you must be more specific with one example if you want to know more.
    Hi Siegfried,
    Thank you for your extensive remarks.I give it a shoot to provide a little more detail.
    Let's assume we have the following table Z_TIMESTAMP:
    Keyfields in that order:
    TIMESTAMP  type     TIMESTAMP
      VTWEG            type     VTWEG
      KSCHL            type     KSCHL
      MATNR            type     ZZ_MATNR
    Non key fields 
    Z_AMOUNT    type   CURR
    The task is now to obtain for multiple MATNRS with multiple VTWEGS in each case the TOP entry in regard to TIMESTAMP field.  KSCHL is not known.
    Meaning the access happens w/o knowing the 1st keyfield. When I got you right an index (if one has to be designed) has to exclude the field TIMESTAMP but include VTWEG and KSCHL.
    The actual interest lies in the field  Z_AMOUNT that is not part of the key.
    I hope these details help!
    I guess I have to loop for each select and probably to work w/ ranges here.  As it can have usually up to three different MATNRs it has to check at a time (The 'youngest' entry of the 'up to three' MATNRs satisfies the requirement - think of different bundles of the same material).
    Can a loop be avoided ?
    Thanks.
    CN.

  • TS1424 I bought a book and it only gave be the first 8 pages, where do i go for a refund?

    I purchased the kids book, "Traction Man is Here!" by Mini Grey. It only gave me the first 8 pages and charged me for it. Where do I go to report for a refund?

    Have you tried deleting the book from the bookshelf in the iBooks app and then re-downloading it via the Purchased tab in the ibookstore in the app ? If it re-downloads in the same incomplete state then try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via Store > View My Account and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that book and use the 'Report a Problem' link (iTunes support should reply within, I think, 24 to 48 hours).
    Some people have had a problem with the 'report a problem' link (it's been taking people to this site on a browser instead of showing a form in iTunes) - if it does that to you then try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page.

  • I use printopia to print from my iPad, trying to print out a 4 page credit card statement, but it only prints out the first page, please help

    I use printopia to print from my iPad, trying to print out a 4 page credit card statement, but it only prints out the first page, please help

    What version of iOS are you using?  Some people were having this problem before, and it was fixed when they updated to iOS 5.

Maybe you are looking for

  • SLES 10 (SP3) on Hyper-V 2012 R2

    I do realize that is unsupported (only SP4 supposedly is) But I have SLES 10 (SP3) image that got converted from vSphere Once I can boot the IDE disk (by editing menu.lst to /hda1 & uninstall Vmware Tools, I would need to get network connectivity, so

  • How do I reinstall PSCS6 and creative cloud?  Download center gives me (amm) protocol error message.

    My computer crashed, had to restore to a pre-photoshop and creative cloud backup.  When I sign in online, every link seems to take me to the download center.  However, when I try to download anything from there, I get a message that says Firefox does

  • IOS7 music album repeat not working however...

    I noticed that in the new update iOS 7 the option to repeat album is gone, however there is a way to repeat your album. Just follow these simple steps: 1) Go to music player 2) In the bottom right it says more, Click It. 3) It says album, click it 4)

  • SMTP sender issue

    I have a SQR reprot which send report via emails. Recently I have changed the SMTP sender to another e-mail address in the configuration file of app server and did a bounce of application server. Now the issue is that the emails are being sent with t

  • Display/Monitor Recommendations Needed

    I'm getting ready to get a 13 inch MacBook Pro to replace my early 2009 iMac. I intend to use it with an external display/monitor and am looking for suggestions that will not break the bank. The Apple dislays are a bit too pricey for me. I'm looking