boolean qaIsGsFake(struct qaSeq *qa)
/* Return TRUE if quality info appears to be faked by 
 * Greg Schuler. (So we can refake it our way...) */
{
int size = qa->size;
BYTE *q = (BYTE*)(qa->qa);

/* Short sequences Greg fakes well enough. */
if (size < 400)
    return FALSE;
if (!allSame(q+200, size-400, 40))
    return FALSE;
if (!allSame(q, 6, 10))
    return FALSE;
if (!allSame(q+size-6, 6, 10))
     return FALSE;
if (!allSame(q+6, 7, 11))
    return FALSE;
return TRUE;  
}
Esempio n. 2
0
void loop(Photos *photo)
{
    Turn *startPtr = calcStartPtr(photo);
    while(last(photo, startPtr))
    {
        /*debug(photo);*/
        rotate(photo, startPtr);
        photo->turns += *(startPtr + photo->maxHold - 1);
        *(startPtr + photo->maxHold - 1) = U;

        startPtr--;
    }

    /*debug(photo);*/
    if (allSame(photo))
        printf("%d\n", photo->turns + *startPtr);
    else
        printf("-1");
}
Esempio n. 3
0
static void searchAllColumns(struct sqlConnection *conn, 
	struct column *colList, char *search)
/* Call search on each column. */
{
struct column *col;
struct searchResult *srList, *sr;
struct columnSearchResults *csrList = NULL, *csr;
int totalCount = 0;
struct searchResult *srOne = NULL;

for (col = colList; col != NULL; col = col->next)
    {
    if (col->simpleSearch)
	 {
         srList = col->simpleSearch(col, conn, search);
	 if (showOnlyCanonical() && srList != NULL)
	     {
	     transformToCanonical(srList, conn);
	     srList = removeDupes(srList);
	     }
	 if (srList != NULL)
	     {
	     srOne = srList;
	     fillInMissingLabels(conn, colList, srList);
	     AllocVar(csr);
	     csr->label = columnSetting(col, "searchLabel", col->longLabel);
	     csr->results = srList;
	     slAddTail(&csrList, csr);
	     totalCount += slCount(srList);
	     }
	 }
    }
if (totalCount == 0)
    {
    displayData(conn, colList, NULL);
    if (anyWild(search))
        warn("Sorry, the search box doesn't take wildcards, "
	     "though in most cases it will find things without "
	     "them.  Try entering your search without * or ? "
	     "characters.");
    else
	warn("Sorry, couldn't find '%s'", search);
    }
else if (totalCount == 1 || allSame(csrList))
// else if (totalCount == 1)
    displayData(conn, colList, &srOne->gp);
else
    {
    makeTitle("Simple Search Results", NULL);
    for (csr = csrList; csr != NULL; csr = csr->next)
        {
	hPrintf("<H2>%s</H2>\n", csr->label);
	slSort(&csr->results, searchResultCmpShortLabel);
	for (sr = csr->results; sr != NULL; sr = sr->next)
	    {
	    selfAnchorSearch(&sr->gp);
	    if (sr->matchingId != NULL)
		hPrintf("%s (%s)", sr->matchingId, sr->shortLabel);
	    else
		hPrintf("%s", sr->shortLabel);
	    hPrintf("</A> - %s<BR>\n", sr->longLabel);
	    }
	}
    }
}