This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
Poco::Data::Statement& pocoSessionParameterBinder(Poco::Data::Statement& stmt, T& t); | |
template<> | |
Poco::Data::Statement& pocoSessionParameterBinder<Poco::Data::AbstractExtraction::Ptr>(Poco::Data::Statement& stmt, Poco::Data::AbstractExtraction::Ptr& t) | |
{ | |
return stmt.addExtract(t); | |
} | |
template<> | |
Poco::Data::Statement& pocoSessionParameterBinder<Poco::Data::AbstractBinding::Ptr>(Poco::Data::Statement& stmt, Poco::Data::AbstractBinding::Ptr& t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename...Ts> | |
void variadicExecutor(Ts&&...) {} | |
template<typename T> | |
Poco::Data::Statement& pocoSessionParameterBinder(Poco::Data::Statement& stmt, T&& t); | |
template<> | |
Poco::Data::Statement& pocoSessionParameterBinder(Poco::Data::Statement& stmt, Poco::Data::AbstractExtraction::Ptr&& t) | |
{ | |
return stmt.addExtract(t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename... Ts> | |
void variadicExecutor(Ts&&...) {} | |
template<typename... TS> | |
bool execute(Poco::Data::Session& session, std::string sql, TS... Fargs) | |
{ | |
Poco::Data::Statement stmt = session << sql; | |
//because for `AbstractExtractors` `comma-operator` is covering this | |
//function. And behind the scene of `into` is exactly `AbstractExtractors`. | |
variadicExecutor(stmt.addExtract(Fargs)...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef Tuple Person; | |
Person pHomer, pLisa; | |
int aHomer(42), aLisa(10), aBart(0); | |
session << "SELECT * FROM Person WHERE Age = ?; " | |
"SELECT Age FROM Person WHERE FirstName = 'Bart'; " | |
"SELECT * FROM Person WHERE Age = ?", | |
into(pHomer, 0), use(aHomer), | |
into(aBart, 1), | |
into(pLisa, 2), use(aLisa); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:for-each select="$valArray"> | |
<xsl:if test="string-length(normalize-space(text())) = 0"> | |
<ОШИБКА> | |
<НомерВпротоколе/> | |
<КодОшибки>30</КодОшибки> | |
<ТипОшибки>Критичная</ТипОшибки> | |
<xsl:variable name="temppos" select="position()"></xsl:variable> | |
<ТекстОшибки><xsl:value-of select="$resArray[$temppos]"></xsl:value-of></ТекстОшибки> | |
<МестоВозникновения> | |
<xsl:copy-of select="."/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:variable name="sumArray"> | |
<sum><xsl:value-of select="//НачисленоСначалаРасчетногоПериода2012/ВсегоСначалаРасчетногоПериода2012/ОПСстраховаяЧасть"/></sum> | |
</xsl:variable> | |
<xsl:variable name="psumArray" select="document('')//xsl:variable[@name= 'sumArray']/*"></xsl:variable> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def GetWithFile(self, client, servicename, modelthings): | |
func = client.service.__getattr__('Retrieve' + servicename) | |
clientclass = func.clientclass({}) | |
SoapClient = clientclass(func.client, func.method) | |
binding = func.method.binding.input | |
soap_xml = binding.get_message(func.method, [modelthings], {}) | |
#changing SOAP request to receive attachments. May be used different way in other SOAP | |
soap_xml.children[0].children[1].children[0].attributes.append(u'attachmentInfo="true"') | |
soap_xml.children[0].children[1].children[0].attributes.append(u'attachmentData="true"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
from random import randint | |
def IncreaseDefine(define, lines): | |
for idx, item in enumerate(lines): | |
if define in item: | |
tmp_str = item.split() | |
tmp_str[2] = str(int(tmp_str[2])+1)+"\n" | |
item = ' '.join(tmp_str) | |
line[idx] = item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IPC transport is not available on Windows and OpenVMS. | |
#if defined ZMQ_HAVE_WINDOWS || defined ZMQ_HAVE_OPENVMS | |
if (protocol_ == "ipc") { | |
// Unknown protocol. | |
errno = EPROTONOSUPPORT; | |
return -1; | |
} | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ZMQ_test.cpp : Defines the entry point for the console application. | |
// | |
#include "zmq.hpp" | |
#include <iostream> | |
#include <boost\thread.hpp> | |
#include "Poco\Process.h" | |
#include <sstream> | |
#ifndef _WIN32 |
NewerOlder