//--------------------------------------------------------------------------- void __fastcall TCPEmpresas::PHDS1BeforePost( TObject* Sender ) { if(PHDS1->GT(EMPRESAS_DATASALDOCX) > 0 && PHDS1->GT(EMPRESAS_DATASALDOCX) < PHDS1->GT(EMPRESAS_DATAINICIO)) throw Exception("A 'Data Saldo' deve ser maior ou igual a 'Data Início'."); if(PHDS1->GT(EMPRESAS_DATASALDOCX) == "") PHDS1->SV(EMPRESAS_SALDOCX, 0, (double)0.0); Perform( WM_NEXTDLGCTL, 0, false ); // força atualização para 'Buffer' do controle que tem foco Perform( WM_NEXTDLGCTL, 1, false ); // força atualização para 'Buffer' do controle que tem foco }
bool wxCurlFTP::Rename(const wxString& szRemoteLocName, const wxString& szRemoteFile /*= wxEmptyString*/) { if(m_pCURL) { SetCurlHandleToDefaults(szRemoteFile); wxString url(GetURL().c_str(), wxConvUTF8); m_szCurrFullPath = url.BeforeLast('/'); m_szCurrFullPath += wxS("/"); m_szCurrFilename = url.AfterLast('/'); if(m_szCurrFilename.IsEmpty()) return false; AppendPostQuote(wxS("RNFR ") + m_szCurrFilename, true); AppendPostQuote(wxS("RNTO ") + szRemoteLocName); SetCurlHandleQuoteOpts(); SetOpt(CURLOPT_NOBODY, TRUE); if(Perform()) { ResetAllQuoteLists(); return ((m_iResponseCode > 199) && (m_iResponseCode < 300)); } ResetAllQuoteLists(); } return false; }
bool wxCurlFTP::Put(wxInputStream& buffer, const wxString& szRemoteFile /*= wxEmptyString*/) { curl_off_t iSize = 0; if(m_pCURL && buffer.IsOk()) { SetCurlHandleToDefaults(szRemoteFile); iSize = buffer.GetSize(); if(iSize == (~(ssize_t)0)) return false; SetOpt(CURLOPT_UPLOAD, TRUE); SetStreamReadFunction(buffer); SetOpt(CURLOPT_INFILESIZE_LARGE, iSize); if(Perform()) { return ((m_iResponseCode > 199) && (m_iResponseCode < 300)); } } return false; }
//#include <BRepBuilder.hxx> TopoDS_Shape Edgesort::GetDesiredCutShape(int desiredIndex) { m_edges.clear(); m_EdgeBBoxMap.clear(); m_vertices.clear(); Perform(); if (m_EdgeBBoxMap.size()>1) { if (desiredIndex == 1) //Return the smallest to return it { m_edges = m_EdgeBBoxMap.begin()->second; } else { m_edges = m_EdgeBBoxMap.rbegin()->second; } BRep_Builder aBuilder; TopoDS_Compound aCompound; aBuilder.MakeCompound(aCompound); for (m_edgeIter = m_edges.begin();m_edgeIter!=m_edges.end();++m_edgeIter) { aBuilder.Add(aCompound,*m_edgeIter); } return aCompound; } else { return m_shape; } //Go through the edges of the result you do not like and remove this result from the original shape }
bool wxCurlHTTP::Put(wxInputStream& buffer, const wxString& szRemoteFile /*= wxEmptyString*/) { curl_off_t iSize = 0; if(m_pCURL && buffer.IsOk()) { SetCurlHandleToDefaults(szRemoteFile); iSize = buffer.GetSize(); if(iSize == (~(size_t)0)) // wxCurlHTTP does not know how to upload unknown length streams. return false; SetOpt(CURLOPT_UPLOAD, TRUE); SetOpt(CURLOPT_PUT, TRUE); SetStreamReadFunction(buffer); SetOpt(CURLOPT_INFILESIZE_LARGE, (curl_off_t)iSize); SetStringWriteFunction(m_szResponseBody); if(Perform()) { return IsResponseOk(); } } return false; }
bool wxCurlHTTP::Trace(const wxString& szRemoteFile /*= wxEmptyString*/) { if(m_pCURL) { SetCurlHandleToDefaults(szRemoteFile); m_arrHeaders.Add(wxT("Content-type: message/http")); SetHeaders(); SetOpt(CURLOPT_CUSTOMREQUEST, "TRACE"); SetStringWriteFunction(m_szResponseBody); if(Perform()) { ResetHeaders(); return IsResponseOk(); } ResetHeaders(); } return false; }
bool wxCurlFTP::RmDir(const wxString& szRemoteLoc /*= wxEmptyString*/) { if(m_pCURL) { wxString str(szRemoteLoc); if(str.Last() != wxS('/')) str += wxS("/"); SetCurlHandleToDefaults(str); wxString url(GetURL().c_str(), wxConvUTF8); m_szCurrFullPath = url.Left(url.Len() - 1).BeforeLast(wxS('/')); m_szCurrFullPath += wxS("/"); m_szCurrFilename = url.Left(url.Len() - 1).AfterLast(wxS('/')); if(m_szCurrFilename.IsEmpty()) return false; AppendPostQuote(wxS("RMD ") + m_szCurrFilename, true); SetCurlHandleQuoteOpts(); SetOpt(CURLOPT_NOBODY, TRUE); if(Perform()) { ResetAllQuoteLists(); return ((m_iResponseCode > 199) && (m_iResponseCode < 300)); } ResetAllQuoteLists(); } return false; }
//--------------------------------------------------------------------------- // // Entry point // //--------------------------------------------------------------------------- int main(int argc, char* argv[]) { CMyCallbackHandler myHandler; CWhatheverYouWantToHold myView; Perform( &myHandler, &myView ); return 0; }
void Edgesort::Init() { Perform(); m_edges.clear(); m_edges = m_EdgeBBoxMap.begin()->second; m_edgeIter = m_edges.begin(); }
// FORWARD FOURIER TRANSFORM, INPLACE VERSION // Data - both input data and output // N - length of input data bool CFFT::Forward(complex * const Data, const unsigned int N) { // Check input parameters if (!Data || N < 1 || (N & (N - 1))) return false; // Rearrange Rearrange(Data, N); // Call FFT implementation Perform(Data, N); // Succeeded return true; }
IC void Perform (u32 ID) { if (ID==InvalidNode) return; if (ID>=q_Marks.size()) return; if (q_Marks[ID]) return; q_Marks[ID] = true; q_Clear.push_back (ID); vertex& N = g_nodes[ID]; if (q_Base.distance_to_sqr(N.Pos)>cover_sqr_dist) return; // ok q_List.push_back (ID); Perform (N.n1); Perform (N.n2); Perform (N.n3); Perform (N.n4); }
void ScatterCtrl_Demo::Preview() { Report r; r.Landscape(); Size pageSize = r.GetPageSize(); const Drawing &w = Examples()[examplesList.GetCursor()].ctrl()->Scatter().GetDrawing(Size(800, 600)); r.DrawDrawing(0, 0, pageSize.cx, pageSize.cy, w); Perform(r); }
void Edgesort::ReInit(const TopoDS_Shape& aShape) { m_shape= aShape; m_done = false; m_edges.clear(); m_EdgeBBoxMap.clear(); m_vertices.clear(); Perform(); m_edges.clear(); m_edges = m_EdgeBBoxMap.begin()->second; m_edgeIter = m_edges.begin(); }
// FORWARD FOURIER TRANSFORM // Input - input data // Output - transform result // N - length of both input data and result bool FFT::Forward(const complex *const Input, complex *const Output, const unsigned int N) { // Check input parameters if (!Input || !Output || N < 1 || N & (N - 1)) return false; // Initialize data Rearrange(Input, Output, N); // Call FFT implementation Perform(Output, N); // Succeeded return true; }
void SyGBeginEditingTask::Perform ( const Time delta, Time* maxSleepTime ) { if (TimeToPerform(delta, maxSleepTime)) { Perform(); } }
void Edgesort::Perform() { if ( m_shape.IsNull() ) return; //adds all the vertices to a map, and store the associated edges TopExp_Explorer explorer; Standard_Integer nbEdges = 0; Standard_Integer nbNonEdges = 0; for ( explorer.Init(m_shape,TopAbs_EDGE) ; explorer.More() ; explorer.Next() ) { const TopoDS_Edge& currentEdge = TopoDS::Edge(explorer.Current()); if (IsValidEdge(currentEdge)) { Perform(currentEdge); nbEdges++; } else { nbNonEdges++; } } //now, iterate through the edges to sort them do { m_edges.clear(); tMapPntEdge::iterator iter = m_vertices.begin(); const gp_Pnt& firstPoint = iter->first; gp_Pnt currentPoint = firstPoint; Standard_Boolean toContinue; do { toContinue = PerformEdges(currentPoint); } while (toContinue == Standard_True); tEdgeBBoxPair aTempPair; aTempPair.first = getBoundingBox(m_edges); aTempPair.second = m_edges; m_EdgeBBoxMap.insert(aTempPair); } while (!m_vertices.empty()); m_done = true; }
bool CMultiHttp::Run() { if( m_murl==NULL ) return false; int still_running=0; if( m_state==CMultiHttp::Initialize ) { m_state=CMultiHttp::Running; while( CURLM_CALL_MULTI_PERFORM==curl_multi_perform(m_murl,&still_running) ) ; } return Perform(); }
bool QtfReport0(const String& qtf, const char *name, bool pagenumbers, Size pagesize) { Report r; if(!IsNull(pagesize)) r.SetPageSize(pagesize); if(pagenumbers) { Report rr; rr.Footer("[1> $$P]"); rr << qtf; r.Footer("[1> $$P/" + AsString(rr.GetCount()) + "]"); } r << qtf; return Perform(r, name); }
// INVERSE FOURIER TRANSFORM // Input - input data // Output - transform result // N - length of both input data and result // Scale - if to scale result bool FFT::Inverse(const complex *const Input, complex *const Output, const unsigned int N, const bool Scale /* = true */) { // Check input parameters if (!Input || !Output || N < 1 || N & (N - 1)) return false; // Initialize data Rearrange(Input, Output, N); // Call FFT implementation Perform(Output, N, true); // Scale if necessary if (Scale) FFT::Scale(Output, N); // Succeeded return true; }
// INVERSE FOURIER TRANSFORM, INPLACE VERSION // Data - both input data and output // N - length of both input data and result // Scale - if to scale result bool FFT::Inverse(complex *const Data, const unsigned int N, const bool Scale /* = true */) { // Check input parameters if (!Data || N < 1 || N & (N - 1)) return false; // Rearrange Rearrange(Data, N); // Call FFT implementation Perform(Data, N, true); // Scale if necessary if (Scale) FFT::Scale(Data, N); // Succeeded return true; }
bool wxCurlFTP::Get(wxOutputStream& buffer, const wxString& szRemoteFile /*= wxEmptyString*/) { if(m_pCURL && buffer.IsOk()) { SetCurlHandleToDefaults(szRemoteFile); SetStreamWriteFunction(buffer); if(Perform()) { return ((m_iResponseCode > 199) && (m_iResponseCode < 299)); } } return false; }
bool wxCurlHTTP::Delete(const wxString& szRemoteLoc /*= wxEmptyString*/) { if(m_pCURL) { SetCurlHandleToDefaults(szRemoteLoc); SetOpt(CURLOPT_CUSTOMREQUEST, "DELETE"); SetStringWriteFunction(m_szResponseBody); if(Perform()) { return IsResponseOk(); } } return false; }
bool wxCurlHTTP::Get(wxOutputStream& buffer, const wxString& szRemoteFile /*=wxEmptyString*/) { if(m_pCURL && buffer.IsOk()) { SetCurlHandleToDefaults(szRemoteFile); SetOpt(CURLOPT_HTTPGET, TRUE); SetStreamWriteFunction(buffer); if(Perform()) { return IsResponseOk(); } } return false; }
bool wxCurlHTTP::Head(const wxString& szRemoteFile /*= wxEmptyString*/) { if(m_pCURL) { SetCurlHandleToDefaults(szRemoteFile); SetOpt(CURLOPT_HTTPGET, TRUE); SetOpt(CURLOPT_NOBODY, TRUE); if(Perform()) { return IsResponseOk(); } } return false; }
bool wxCurlFTP::Nlst(const wxString& szRemoteLoc /*= wxEmptyString*/) { if(m_pCURL) { SetCurlHandleToDefaults(szRemoteLoc); SetOpt(CURLOPT_CUSTOMREQUEST, "NLST"); SetStringWriteFunction(m_szResponseBody); if(Perform()) { return ((m_iResponseCode > 199) && (m_iResponseCode < 300)); } } return false; }
bool wxCurlHTTP::Post(const wxString& szRemoteFile /*= wxEmptyString*/) { if(m_pCURL && m_pPostHead && m_pPostTail) { SetCurlHandleToDefaults(szRemoteFile); SetOpt(CURLOPT_POST, TRUE); SetOpt(CURLOPT_HTTPPOST, m_pPostHead); SetStringWriteFunction(m_szResponseBody); if(Perform()) { return IsResponseOk(); } } return false; }
bool wxCurlFTP::Info(const wxString& szRemoteLoc /*= wxEmptyString*/) { if(m_pCURL) { SetCurlHandleToDefaults(szRemoteLoc); SetOpt(CURLOPT_HEADER, TRUE); SetOpt(CURLOPT_NOBODY, TRUE); SetStringWriteFunction(m_szResponseBody); if(Perform()) { return ((m_iResponseCode > 199) && (m_iResponseCode < 299)); } } return false; }
//--------------------------------------------------------------------------- void __fastcall TRichEdit20::WMPaste() { // override default pasting to prevent inserting formatted text (RTF). const wchar_t * Text = NULL; HANDLE Handle = OpenTextFromClipboard(Text); if (Handle != NULL) { try { // replacement for EM_PASTESPECIAL, // which ignores trailing line end for some reason Perform(EM_REPLACESEL, true, reinterpret_cast<int>(Text)); } __finally { CloseTextFromClipboard(Handle); } } }
bool wxCurlFTP::MkDir(const wxString& szRemoteLoc /*= wxEmptyString*/) { if(m_pCURL) { wxString str(szRemoteLoc); if(str.Last() != '/') str += wxS("/"); SetCurlHandleToDefaults(str); SetOpt(CURLOPT_FTP_CREATE_MISSING_DIRS, TRUE); SetOpt(CURLOPT_NOBODY, TRUE); if(Perform()) { return ((m_iResponseCode > 199) && (m_iResponseCode < 300)); } } return false; }
void EvaluatePreFix(char input[]) { int length,i,operand1,operand2; length=strlen(input); char result; for(i=length-1;i>=0;i--) { if(input[i]=='+' || input[i]=='-' || input[i]=='*' || input[i]=='/') { operand1=Top();pop(); operand2=Top();pop(); result=Perform(input[i],operand1,operand2); push(result+'0'); } else { push(input[i]); } } }