int
D3DOverdrawWindow::
ResetDevice(void)
{
    Superclass::ResetDevice();

    if (!SetQuery())
    {
        return 0;
    }

    if (!m_pSoup) { return 1; }

    m_pSoup->ComputeNormals(); //TODO: check if we need this

    // create vertex buffer
    if (!SetVB())
    {
        return 0;
    }

    if (!SetIB())
    {
        return 0;
    }

    if (!SetVD())
    {
        return 0;
    }

    return 1;
}
Exemple #2
0
  void OnPrivmsgChannel(User *u, Channel *c, const Flux::vector &params)
  {
    //Flux::vector MessageParams = StringVector(params, ' ');
    Flux::string msg;
    for(unsigned i=0; i < params.size(); ++i)
      msg += params[i]+' ';

    Flux::string cmd = params.empty()?"":params[0];

    if(cmd.equals_ci("!encyclopedia"))
    {
      SetQuery(1, params);
      Brain(u,query);
    }

    if(msg.search_ci(Config->BotNick+", what do you know about "))
    {
      SetQuery(6, params);
      Brain(u, query);
    }

    else if(msg.search_ci(Config->BotNick+", what is a ") ^ msg.search_ci(Config->BotNick+", what is the") ^ msg.search_ci(Config->BotNick+", tell me about ") ^ msg.search_ci(Config->BotNick+", who are the ") ^ msg.search_ci(Config->BotNick+", what is an "))
    {
      SetQuery(4, params);
      Brain(u, query);
    }

    else if(msg.search_ci(Config->BotNick+", what is ") ^ msg.search_ci(Config->BotNick+", what are ") ^ msg.search_ci(Config->BotNick+", who is ") ^ msg.search_ci(Config->BotNick+", what's a ") ^ msg.search_ci(Config->BotNick+", what's an "))
    {
      SetQuery(3, params);
      Brain(u, query);
    }

    else if(msg.search_ci(Config->BotNick+", tell me what you know about "))
    {
      SetQuery(7, params);
      Brain(u, query);
    }
  }
Exemple #3
0
BOOL SFStatement::CreateStatement(SQLHANDLE hStmt)
{
	if(m_hStmt != SQL_NULL_HANDLE)
		return FALSE;

	m_hStmt = hStmt;
	m_usBindParam = 0;
	m_usBindCol = 0;

	SetQuery();

	m_sqlReturn = ::SQLPrepare(m_hStmt, m_szQuery, SQL_NTS);
	if(!SH_SQL_SUCCESS(m_sqlReturn))
		return FALSE;

	return (BindParameters() && BindColumns());
}
void COverallDataView::OnSurveytreeRainbowcolorsurveys() 
{
	int iColorSchemeIndex=m_colorSchemeComboBox.GetColorScheme();
	if (iColorSchemeIndex>=MAX_REGULAR_COLOR_SCHEMES)
	{
		SetColorSchemeIndex(0);
		iColorSchemeIndex=0;
	}
	SetQuery(NULL);
	CFolder * pFolder=pDocument_G->GetSurveyFolder();
	if (pFolder!=NULL)
	{
		BOOL bDisabled=FALSE;	//do we need to recalculate any views
		pFolder->SetColor(RGB(255,255,255),iColorSchemeIndex,TRUE,&bDisabled,NULL);
		pView_G->RecalculateGeometry(bDisabled);
		m_masterSurveyList.InvalidateRect(NULL,FALSE);
	}
}
bool SQLQueryHolder::SetPQuery(size_t index, const char *format, ...) {
	if (!format) {
		sLog->outError("Query (index: %zu) is empty.", index);
		return false;
	}

	va_list ap;
	char szQuery[MAX_QUERY_LEN];
	va_start(ap, format);
	int res = vsnprintf(szQuery, MAX_QUERY_LEN, format, ap);
	va_end(ap);

	if (res == -1) {
		sLog->outError("SQL Query truncated (and not execute) for format: %s",
				format);
		return false;
	}

	return SetQuery(index, szQuery);
}
bool SQLQueryHolder::SetPQuery(size_t index, const char *format, ...)
{
    if (!format)
    {
        TC_LOG_ERROR("sql.sql", "Query (index: %u) is empty.", uint32(index));
        return false;
    }

    va_list ap;
    char szQuery [MAX_QUERY_LEN];
    va_start(ap, format);
    int res = vsnprintf(szQuery, MAX_QUERY_LEN, format, ap);
    va_end(ap);

    if (res == -1)
    {
        TC_LOG_ERROR("sql.sql", "SQL Query truncated (and not execute) for format: %s", format);
        return false;
    }

    return SetQuery(index, szQuery);
}
Exemple #7
0
bool SqlQueryHolder::SetPQuery(size_t index, const char *format, ...)
{
    if(!format)
    {
        sLog.outLog(LOG_DEFAULT, "ERROR: Query (index: " SIZEFMTD ") is empty.",index);
        return false;
    }

    va_list ap;
    char szQuery [MAX_QUERY_LEN];
    va_start(ap, format);
    int res = vsnprintf( szQuery, MAX_QUERY_LEN, format, ap );
    va_end(ap);

    if(res==-1)
    {
        sLog.outLog(LOG_DEFAULT, "ERROR: SQL Query truncated (and not execute) for format: %s",format);
        return false;
    }

    return SetQuery(index,szQuery);
}
int
D3DOverdrawWindow::
SetSoup(Soup* pSoup)
{

    // re-create vertex and index buffers
    m_pSoup = pSoup;

    if (!SetVB())
    {
        return 0;
    }

    if (!SetIB())
    {
        return 0;
    }

    // create other device objects as needed
    if (!m_VD)
    {
        if (!SetVD())
        {
            return 0;
        }
    }

    if (!m_pOcclusionQuery[0] || !m_pOcclusionQueryPix[0])
    {
        if (!SetQuery())
        {
            return 0;
        }
    }


    return 1;
}
Exemple #9
0
XPathQuery::XPathQuery(const ea::string& queryString, const ea::string& variableString)
{
    SetQuery(queryString, variableString);
}
Exemple #10
0
XPathQuery::XPathQuery(const String& queryString, const String& variableString) :
    query_(0),
    variables_(0)
{
    SetQuery(queryString, variableString);
}
Exemple #11
0
	void GlooxAccount::CreateSDForResource (const QString& resource)
	{
		auto sd = new SDSession (this);
		sd->SetQuery (resource);
		emit gotSDSession (sd);
	}
void COverallDataView::RemoveAll()
{
	m_masterSurveyList.DeleteAllItems();
	m_colorSchemeComboBox.UpdateEntries();
	SetQuery(NULL);
}