コード例 #1
0
/*****************************************************
**
**   GenericTableWriter   ---   appendObjectListTcByConfigKeys
**
******************************************************/
void GenericTableWriter::appendObjectListTcByConfigKeys( Tc &tc, const OBJECT_INCLUDES &objects,
	const TAB_COLUMN_TYPE &style, const bool &vedic, const TEXT_FORMAT )
{
	if ( vedic ) setVedicObjects( objects );
	else setWesternObjects( objects );

	TcColumnSet colset( TAB_LC_PLANETS, vedic );
	colset.cols.push_back( TcColumn( TAB_CT_OBJECT_NAME, vedic ));
	colset.cols.push_back( TcColumn( TAB_CT_LONGITUDE, vedic ));

	if ( style & TAB_CT_LATITUDE ) colset.cols.push_back( TcColumn( TAB_CT_LATITUDE, vedic ));
	if ( style & TAB_CT_90_DEGREE_LONGITUDE ) colset.cols.push_back( TcColumn( TAB_CT_90_DEGREE_LONGITUDE, vedic ));
	if ( style & TAB_CT_45_DEGREE_LONGITUDE ) colset.cols.push_back( TcColumn( TAB_CT_45_DEGREE_LONGITUDE, vedic ));
	if ( style & TAB_CT_ANTISCIA ) colset.cols.push_back( TcColumn( TAB_CT_ANTISCIA, vedic ));
	if ( style & TAB_CT_SIGN_LORD ) colset.cols.push_back( TcColumn( TAB_CT_SIGN_LORD, vedic ));
	if ( style & TAB_CT_ELEMENT ) colset.cols.push_back( TcColumn( TAB_CT_ELEMENT, vedic ));
	if ( style & TAB_CT_SIGNIFICATION ) colset.cols.push_back( TcColumn( TAB_CT_SIGNIFICATION, vedic ));
	if ( style & TAB_CT_SIGN_QUALITY ) colset.cols.push_back( TcColumn( TAB_CT_SIGN_QUALITY, vedic ));
	if ( style & TAB_CT_DIGNITY ) colset.cols.push_back( TcColumn( TAB_CT_DIGNITY, vedic ));
	if ( style & TAB_CT_NAVAMSA ) colset.cols.push_back( TcColumn( TAB_CT_NAVAMSA, vedic ));
	if ( style & TAB_CT_NAKSHATRA ) colset.cols.push_back( TcColumn( TAB_CT_NAKSHATRA, vedic ));
	if ( style & TAB_CT_NAKSHATRA_PADA ) colset.cols.push_back( TcColumn( TAB_CT_NAKSHATRA_PADA, vedic ));
	if ( style & TAB_CT_KP_LORDS ) colset.cols.push_back( TcColumn( TAB_CT_KP_LORDS, vedic ));
	if ( style & TAB_CT_SHASTIAMSA_LORD ) colset.cols.push_back( TcColumn( TAB_CT_SHASTIAMSA_LORD, vedic ));
	if ( style & TAB_CT_CHARA_KARAKA ) colset.cols.push_back( TcColumn( TAB_CT_CHARA_KARAKA, vedic ));
	if ( style & TAB_CT_DASA_VARGA ) colset.cols.push_back( TcColumn( TAB_CT_DASA_VARGA, vedic ));
	if ( style & TAB_CT_HOUSE_POSITION ) colset.cols.push_back( TcColumn( TAB_CT_HOUSE_POSITION, vedic ));
	if ( style & TAB_CT_AV_REKHAPOINTS ) colset.cols.push_back( TcColumn( TAB_CT_AV_REKHAPOINTS, vedic ));

	tc.colsets.push_back( colset );
}
コード例 #2
0
ファイル: gequilibrium.c プロジェクト: ptigwe/gte
void printEquilibrium(Equilibrium eq)
{
    int n = eq.lcpdim;
    colset(n+2);    /* column printing to see complementarity of  w  and  z */
    colprEquilibrium(eq);
    colout();
}
コード例 #3
0
ファイル: col.c プロジェクト: ptigwe/gte
void colpr(const char *s)
{
    int j;
    int w = strlen(s);
    
    if (posinbuf + w + 1 > COLBUFSIZE)
        /* not enough space in current buffer, flush                */
        /* require  w < COLBUFSIZE,  otherwise undefined behavior   */
        {
        int cc = currcol;
        colout();
        printf("\n-----output reset-----\n\n");
        colset(ncols);
        for (j=0; j < cc; j++)
            /* print blank columns to continue in the correct column  */
            buf[posinbuf++] = '\0';
        currcol = cc;
        }
    if (colwidth[currcol] < w)
        colwidth[currcol] = w;
    strcpy(&buf[posinbuf], s);
    posinbuf += w + 1;
    currcol++;
    if (currcol==ncols)     /* this requires  ncols > 0     */
        {
        currcol = 0;
        currlines++;
        }
}
コード例 #4
0
ファイル: normform.c プロジェクト: stengel/ecta2002
void nfprint(void)
{
    char s[MAXSTRL];
    int  i, j;
    printf("NF payoffs:\n");
    
    colset(nstrats[2]+1);
    colleft(0);
    colpr("pay1");
    for (j=0; j<nstrats[2]; j++)
	{
	strattomovetuple(j, 2);
	movetupletoa(2, s);    colpr(s);
	}
    colpr("pay2");
    colnl();
    for (i=0; i<nstrats[1]; i++)
	{
	strattomovetuple(i, 1);
	movetupletoa(1, s);    colpr(s);
	/* payoffs player 1 */
	for (j=0; j<nstrats[2]; j++)
	    {
	    rattoa(nfpay[i][j][0], s);        colpr(s);
	    }
	/* payoffs player 2 */
	colpr("");
	for (j=0; j<nstrats[2]; j++)
	    {
	    rattoa(nfpay[i][j][1], s);        colpr(s);
	    }
	colnl();
	}
    colout();
}       /* end of  nfprint()    */
コード例 #5
0
ファイル: normform.c プロジェクト: stengel/ecta2002
void twolineoutmixed(int pl, Rat *mixed)
{
    int i;
    char s[MAXSTRL];
    int *support;
    int suppsize = 0;


    support = TALLOC( nstrats[pl], int);

    for (i = 0; i < nstrats[pl]; i++)
        if (mixed[i].num != 0)
	    support[suppsize++] = i ;
    colset(suppsize) ;
    for (i = 0; i < suppsize; i++)
        {
        strattomovetuple (support[i], pl);
        movetupletoa(pl, s);
        colpr(s);
        }
    for (i = 0; i < suppsize; i++)
        {
        rattoa(mixed[support[i]], s);
        colpr(s);
        }
   colout();
   free(support);
}
コード例 #6
0
/*****************************************************
**
**   GenericTableWriter   ---   createObjectListTableByConfigKeys
**
******************************************************/
Table *GenericTableWriter::createObjectListTableByConfigKeys( const OBJECT_INCLUDES &objects,
	const TAB_COLUMN_TYPE &style, const bool &vedic, const TEXT_FORMAT tf )
{
	TcColumnSet colset( TAB_LC_PLANETS, vedic );
	Tc tc;
	appendObjectListTcByConfigKeys( tc, objects, style, vedic, tf );
	tc.colsets.push_back( colset );
	return createTable( &tc );
}
コード例 #7
0
int main()
{
    int *a,i,n,m,r,c,x;

    printf("Enter the size of the Board : \nRows :");
    scanf("%d",&n);
    printf("Columns :");
    scanf("%d",&m);

    a=(int *)malloc(sizeof(int)*n*m);

    for(i=0;i<n*m;i++)
    *(a+i)=0;
    display(a,n,m);

    while(i!=-1)
    {

    printf("Enter the choice : \n1. RowSet i a\n2. ColumnSet i a\n3. RowQuery i \n4. ColQuery i \n5. Display \n6. Exit");
    scanf("%d",&i);
    switch(i)
    {
        case 1: printf("Enter the row no > ");
                scanf("%d",&r);
                printf("Value to be assigned :");
                scanf("%d",&x);
                rowset(a,r,x,m);
                break;

      case 2: printf("Enter the col no > ");
                scanf("%d",&c);
                printf("Value to be assigned :");
                scanf("%d",&x);
                colset(a,c,x,n);
                break;

       case 3: printf("Enter the row no > ");
                scanf("%d",&r);
                rowquery(a,r);
                break;
        case 4: printf("Enter the col no > ");
                scanf("%d",&c);
                colquery(a,c);
                break;

       case 5 : display(a,n,m);
                 break;

       case 6 : i=-1;
                break;

      default : printf("Enter a valid option !\n");
    }


    }
}
コード例 #8
0
ファイル: array.cpp プロジェクト: wcstcyx/kfoots
inline GapMat<T> asGapMat(SEXP x){
	if (!Rf_inherits(x, "gapmat")) Rcpp::stop("the given object does not inherit from gapmat");
	Rcpp::List list = Rcpp::as<Rcpp::List>(x);
	//you must make sure that no memory is allocated here. The pointers won't be valid otherwise
	Vec<T> vec((SEXP)list["vec"]);
	Vec<int> colset((SEXP)list["colset"]);
	int nrow = list["nrow"];
	
	return GapMat<T>(vec.ptr, colset.ptr, nrow, colset.len);
}
コード例 #9
0
ファイル: seqform.c プロジェクト: stengel/ecta2002
void sfprint(void)
{
    char s[MAXSTRL];
    int i, j, k;
    printf("SF payoffs and constraints:\n");
    
    colset(nseqs[2]+2+nisets[1]);
    colleft(0);
    colpr("pay1");
    for (j=0; j<nseqs[2]; j++)
	{
        seqtoa(firstmove[2] + j, 2, s);    colpr(s);
	}
    colnl();
    colpr("pay2");
    for (j=0; j<nseqs[2]; j++)
	colpr(" ");
    colpr("cons1");
    for (k=1; k<=nisets[1]; k++)
	/* headers for constraint matrix pl1, printed on right of payoffs   */
	colpr((firstiset[1]+k-1)->name);
    for (i=0; i<nseqs[1]; i++)
	{
	/* payoffs player 1 */
	seqtoa(firstmove[1] + i, 1, s);    colpr(s);
	for (j=0; j<nseqs[2]; j++)
	    {
	    rattoa(sfpay[i][j][0], s);     colpr(s);
	    }
	colnl();
	/* payoffs player 2 */
	colpr("");
	for (j=0; j<nseqs[2]; j++)
	    {
	    rattoa(sfpay[i][j][1], s);     colpr(s);
	    }
	/* constraints player 1 */
	for (k=0; k<=nisets[1]; k++)
	    colipr(sfconstr[1][k][i]);    
	colnl();
	}
    /* constraints player 2 */
    for (k=0; k<=nisets[2]; k++)
	{
	colnl();
	if (k==0)
	    colpr("cons2");
	else
	    colpr((firstiset[2]+k-1)->name);
	for (j=0; j<nseqs[2]; j++)
	    colipr(sfconstr[2][k][j]);
	colnl();
	}
    colout();
}       /* end of  sfprint()            */
コード例 #10
0
ファイル: seqform.c プロジェクト: stengel/ecta2002
void outrealplan(int pl, Rat *rplan)
{
    int i;
    char s[MAXSTRL];

    colset(nseqs[pl]) ;
    for (i = 0; i < nseqs[pl]; i++)
        {
        seqtoa(firstmove[pl] + i, pl, s);
        colpr(s);
        }
    for (i = 0; i < nseqs[pl]; i++)
        {
        rattoa(rplan[i], s);
        colpr(s);
        }
   colout();
}
コード例 #11
0
ファイル: normform.c プロジェクト: stengel/ecta2002
void compatstrats(int pl)
{
    char s[MAXSTRL];
    Move seq;
    int i,j,nl;
    int **compattable;
    int  *slist;    /* list of strategies   */
    
    T2ALLOC(compattable, nstrats[pl], nseqs[pl], int);
    slist = TALLOC (nstrats[pl], int);
    
    for (seq = firstmove[pl]; seq < firstmove[pl+1]; seq++)
	{
	j = seq - firstmove[pl];
	nl = seqtostratlist(seq, pl, slist);
	for (i=0; i<nl; i++)
	    compattable [slist[i]] [j] = 1;
	}
    
    printf("\nStrategies compatible with sequences for player %d:\n", pl);
    
    colset(nseqs[pl]+1);
    colleft(0);
    colpr("");
    for (seq = firstmove[pl]; seq < firstmove[pl+1]; seq++)
	{
	seqtoa(seq, pl, s);    colpr(s);
	}
    for (i=0; i<nstrats[pl]; i++)
	{
	strattomovetuple(i, pl);
	movetupletoa(pl, s);   colpr(s);
	for (j=0; j<nseqs[pl]; j++)
	    if (compattable[i][j])
		colpr("x");
	    else
		colpr("");
	}
    colout();
    FREE2(compattable, nstrats[pl]);
    free(slist);
}       /* end of  compatstrats(pl)    */
コード例 #12
0
void FCharacter::initClass()
{
    statusIcons[ (quint32)STATUS_ONLINE] = new QIcon ( ":/images/status-default.png" ); //STATUS_ONLINE
    statusIcons[ (quint32)STATUS_LOOKING] = new QIcon ( ":/images/status.png" ); 		//STATUS_LOOKING
    statusIcons[ (quint32)STATUS_BUSY] = new QIcon ( ":/images/status-away.png" );		//STATUS_BUSY
    statusIcons[ (quint32)STATUS_DND] = new QIcon ( ":/images/status-busy.png" );		//STATUS_DND
    statusIcons[ (quint32)STATUS_CROWN] = new QIcon ( ":/images/crown.png" );			//STATUS_CROWN
    statusIcons[ (quint32)STATUS_AWAY] = new QIcon( ":/images/status-blue" );			//STATUS_AWAY

    statusStrings[ (quint32)STATUS_ONLINE] = "Online";
    statusStrings[ (quint32)STATUS_LOOKING] = "Looking";
    statusStrings[ (quint32)STATUS_BUSY] = "Busy";
    statusStrings[ (quint32)STATUS_DND] = "Do Not Disturb";
    statusStrings[ (quint32)STATUS_CROWN] = "Crowned";
    statusStrings[ (quint32)STATUS_AWAY] = "Away";

    genderStrings[ (quint32)GENDER_NONE] = "None";
    genderStrings[ (quint32)GENDER_MALE] = "Male";
    genderStrings[ (quint32)GENDER_FEMALE] = "Female";
    genderStrings[ (quint32)GENDER_TRANSGENDER] = "Transgender";
    genderStrings[ (quint32)GENDER_SHEMALE] = "Shemale";
    genderStrings[ (quint32)GENDER_HERM] = "Hermaphrodite";
    genderStrings[ (quint32)GENDER_MALEHERM] = "Male Hermaphrodite";
    genderStrings[ (quint32)GENDER_CUNTBOY] = "C**t-Boy";
    genderStrings[ (quint32)GENDER_OFFLINE_UNKNOWN] = "Offline/Unknown";

    genderColors[ (quint32)GENDER_NONE] = QColor ( 255, 255, 255 );
    genderColors[ (quint32)GENDER_MALE] = QColor ( 102, 247, 255 );
    genderColors[ (quint32)GENDER_FEMALE] = QColor ( 255, 102, 184 );
    genderColors[ (quint32)GENDER_TRANSGENDER] = QColor ( 102, 255, 166 );
    genderColors[ (quint32)GENDER_SHEMALE] = QColor ( 224, 255, 102 );
    genderColors[ (quint32)GENDER_HERM] = QColor ( 212, 102, 255 );
    genderColors[ (quint32)GENDER_MALEHERM] = QColor ( 255, 189, 102 );
    genderColors[ (quint32)GENDER_CUNTBOY] = QColor ( 115, 102, 255 );
    genderColors[ (quint32)GENDER_OFFLINE_UNKNOWN] = QColor ( 127, 127, 127 );

    QSettings colset("./colors.ini", QSettings::IniFormat);
    if(colset.status() != QSettings::NoError)
    {
        return;
    }
    QStringList colstr;
    colstr = colset.value("gender/none").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_NONE] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
    colstr = colset.value("gender/male").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_MALE] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
    colstr = colset.value("gender/female").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_FEMALE] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
    colstr = colset.value("gender/transgender").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_TRANSGENDER] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
    colstr = colset.value("gender/shemale").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_SHEMALE] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
    colstr = colset.value("gender/herm").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_HERM] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
    colstr = colset.value("gender/maleherm").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_MALEHERM] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
    colstr = colset.value("gender/cuntboy").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_CUNTBOY] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
    colstr = colset.value("gender/offlineunknown").toStringList();
    if(colstr.size() >= 2) {
        genderColors[ (quint32)GENDER_OFFLINE_UNKNOWN] = QColor( colstr[0].toInt(), colstr[1].toInt(), colstr[2].toInt() );
    }
}