X nomy(void) { X v = getxx(); v->type = "-nomq"; v->list.s[0] = "the fact that"; return v; }
int main (int argc, char **argv) { FILE *ofile; int nlambda = 0; int i, m; double zn, zvar, tw, tail; double *xx[0], *lambda; readcommands (argc, argv); settwxtable (twxtab); if (oname == NULL) ofile = stdout; else openit (oname, &ofile, "w"); if (iname == NULL) fatalx ("i paraameter compulsory\n"); nlambda = numlines (iname); ZALLOC(lambda, nlambda, double); xx[0] = lambda; nlambda = getxx (xx, nlambda, 1, iname); vst (lambda, lambda, -1.0, nlambda); sortit (lambda, NULL, nlambda); vst (lambda, lambda, -1.0, nlambda); m = numgtz (lambda, nlambda); fprintf (ofile, "%4s %12s", "#N", "eigenvalue"); fprintf (ofile, "%12s", "difference"); fprintf (ofile, " %9s %12s", "twstat", "p-value"); fprintf (ofile, " %9s", "effect. n"); fprintf (ofile, "\n"); for (i = 0; i < m; ++i) { zn = nval; tail = dotwcalc (lambda + i, m - i, &tw, &zn, &zvar, minleneig); fprintf (ofile, "%4d %12.6f", i + 1, lambda[i]); if (i == 0) fprintf (ofile, "%12s", "NA"); else fprintf (ofile, "%12.6f", lambda[i] - lambda[i - 1]); if (tail >= 0.0) fprintf (ofile, " %9.3f %12.6g", tw, tail); else fprintf (ofile, " %9s %12s", "NA", "NA"); if (zn > 0.0) { fprintf (ofile, " %9.3f", zn); } else { fprintf (ofile, " %9s", "NA"); } fprintf (ofile, "\n"); } return 0; }
X rel(void) { static char *c[] = {"that", "which"}; X v = getxx(); v->type = "-rel"; v->list.s[0] = CHOOSE(c); return v; }
void gettw(double x, double *tailp, double *densp) // main routine for accessing twtable { int k, n ; double x0, x1, f0, f1, f0p, f1p ; double *xx[3] ; if (twtabsize = -1) { if (settwxtable(TWXTABLE) < 0) fatalx("twtable not readable %s\n", TWXTABLE) ; k = numlines(twxtable) ; ZALLOC(twxval, k, double) ; ZALLOC(twxpdf, k, double) ; ZALLOC(twxtail, k, double) ; xx[0] = twxval ; xx[1] = twxtail ; xx[2] = twxpdf ; twtabsize = getxx(xx, k, 3, twxtable) ; } n = twtabsize ; k = firstgtx(x, twxval, n) ; if (k<=0) { *tailp = 1.0 ; *densp = 0.0 ; return ; } if (k>=n) { *tailp = twdensx(x) ; *densp = twtailx(x) ; return ; } x0 = twxval[k-1] ; x1 = twxval[k] ; f0 = twxtail[k-1] ; f0p = twxpdf[k-1] ; f1 = twxtail[k] ; f1p = twxpdf[k] ; // now do cubic interpolation cinterp(x, x0, x1, f0, -f0p, f1, -f1p, tailp, densp) ; *densp = - *densp ; /** printf("zzz %9.3f %9.3f %9.3f\n", x0, x1, x) ; printf("zz1 %9.3f %9.3f %9.3f\n", f0, f1, *tailp) ; printf("zz2 %9.3f %9.3f %9.3f\n", f0p, f1p, *densp) ; */ }
X sent(E env) { X sentv = getxx(); sentv->type = "sent"; if (prob(0.09)) { env->unspec = ""; sentv->list.x[1] = np(env); sentv->list.x[3] = aux(env); sentv->list.x[4] = vp(env); sentv->list.x[0] = nomq(env); sentv->list.x[2] = rel(); return sentv; } sentv->list.x[0] = np(env); sentv->list.x[1] = aux(env); sentv->list.x[2] = vp(env); return sentv; }
X nomq(E env) { X v = getxx(); v->type = "-nomq"; if (EQ(env->number, "sing")) { if (EQ(tense(), "past")) v->list.s[0] = "there was"; else v->list.s[0] = "there is"; } else { if (EQ(tense(), "past")) v->list.s[0] = "there were"; else v->list.s[0] = "there are"; } if (prob(0.2)) v->list.s[1] = " not"; return v; }
void sampinfo(u8 *data, int size) { int info, namelen, modelen, maplen, pwd, pl, maxpl; u8 *name, *mode, *map, *p, *l; p = data; l = data + size; p += 4 + 4 + 2; p += getxx(p, &info, 8); if(info != 'i') { printf("\nAlert: no info packet received\n"); return; } p += getxx(p, &pwd, 8); p += getxx(p, &pl, 16); p += getxx(p, &maxpl, 16); p += getxx(p, &namelen, 32); p += getmm(p, &name, namelen); p += getxx(p, &modelen, 32); p += getmm(p, &mode, modelen); p += getxx(p, &maplen, 32); p += getmm(p, &map, maplen); printf( "\n" " Name Server: %.*s\n" " GameMode: %.*s\n" " Map: %.*s\n" " Online: %hu/%hu\n" " Password: %s\n" "\n", namelen, name, modelen, mode, maplen, map, pl, maxpl, pwd ? "yes" : "no"); }
void pulsesequence() { // Set the Maximum Dynamic Table Number settablenumber(10); setvvarnumber(30); // Define Variables and Objects and Get Parameter Values WMPA xx = getxx("xxX"); strncpy(xx.ch,"obs",3); putCmd("chXxx='obs'\n"); //-------------------------------------- // Copy Current Parameters to Processed //------------------------------------- putCmd("groupcopy('current','processed','acquisition')"); // Dutycycle Protection DUTY d = init_dutycycle(); d.dutyon = getval("pwXprep") + 2.0*xx.cycles*xx.pw; d.dutyoff = d1 + 4.0e-6 + 5.0e-6 + xx.r1 + xx.r2 + at - 2.0*xx.cycles*xx.pw; d = update_dutycycle(d); abort_dutycycle(d,10.0); // Set Phase Tables settable(phXprep,4,table1); settable(phXxx,4,table2); settable(phRec,4,table3); setreceiver(phRec); // Set the Small-Angle Prep Phase double obsstep = 360.0/(PSD*8192); obsstepsize(obsstep); int phfXprep = initphase(getval("phXprep"), obsstep); int phXzero = initphase(0.0, obsstep); // Begin Sequence xmtrphase(phfXprep); txphase(phXprep); obspwrf(getval("aXprep")); obsunblank(); decunblank(); _unblank34(); delay(d1); sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6); // Preparation Pulse with Initial Point startacq(5.0e-6); rcvroff(); delay(xx.r1); rgpulse(getval("pwXprep"), phXprep, 0.0, 0.0); xmtrphase(phXzero); // Apply Semi-windowless WHH4 Cycles decblank(); _blank34(); _xx(xx, phXxx); endacq(); obsunblank(); decunblank(); _unblank34(); }