예제 #1
0
파일: jointfind.cpp 프로젝트: goshng/cocoa
/* keeps calling nextgen() until a peak has been found */ 
double difeloop(int modelparams, int modelnum)
{
  int gen;
  double spread, lowpd, hipd;
  /* static double pd; Never used */

  gen = 0;
  do
  {
    nextgen(&lowpd, &hipd,modelparams,modelnum);
    spread = hipd - lowpd;
    gen++;
  }
  while (spread > SPREADTOL);
  return  lowpd;
} // difeloop
예제 #2
0
파일: client.C 프로젝트: bougyman/sfs
client::client (ref<axprt_crypt> x)
  : sfsserv (x), fsrv (NULL), generation (nextgen ())
{
  nfssrv = asrv::alloc (x, ex_nfs_program_3,
			wrap (mkref (this), &client::nfs3pre_acl_dispatch));
  nfscbc = aclnt::alloc (x, ex_nfscb_program_3);

  char sfs_owner[] = SFSOWNER;
  struct passwd *pw = getpwnam (sfs_owner);
  
  int u_sfs = pw->pw_uid;  
  int g_sfs = pw->pw_gid; 
  int g_sock = pw->pw_gid; //fixme: put something different!
  int g_fifo = pw->pw_gid; //likewise

  auth_sfs = authunix_create ("localhost", u_sfs, g_sfs, 0, NULL);
  auth_sfssock = authunix_create ("localhost", u_sfs, g_sock, 0, NULL);
  auth_sfsfifo = authunix_create ("localhost", u_sfs, g_fifo, 0, NULL);

  clienttab.insert (this);
}
예제 #3
0
        // ******** *****   ***      ******* *****
        // ******** *****   ***      ******* *****
        // <1sp><8*><1sp><5*><3sp><3*><6sp><7*><1sp><5*><1sp>
        // 1 + 8 + 1 + 5 + 3 + 3 + 6 + 7 + 1 + 5 + 1 = 41
        // 8 + 5 + 3 + 7 + 5 = 28
        
        Pos board[100] = {
            {.x = w-19, .y = h}, {w-18,h}, {w-17,h}, {w-16,h}, {w-15,h}, {w-14,h}, {w-13,h}, {w-12,h},
            {w-10,h}, {w-9,h}, {w-8,h}, {w-7,h}, {w-6,h},
            {w-2,h}, {w-1,h}, {w,h},
            {w+7,h}, {w+8,h}, {w+9,h}, {w+10,h}, {w+11,h}, {w+12,h}, {w+13,h},
            {w+15,h}, {w+16,h}, {w+17,h}, {w+18,h}, {w+19,h}
        };
        
        
        Pos *hold = nextgen(board, 100);
        
        for(int i = 0; i < 100; i++) {
            hold = nextgen(hold, 100);
        }
        
        showcells(board, 100);
        // life(board, sizeof(board) / sizeof(Pos));
    }
    
    return 0;
}


void life(Pos *board, int length) {
    getchar();