lang
stringclasses 10
values | seed
stringlengths 5
2.12k
|
---|---|
cpp | #include "sim/init.hh"
extern "C" {
void init_param_SnoopFilter();
}
|
cpp | #include "profilepage.h"
ProfilePage::ProfilePage(QWidget *parent) : QWidget(parent)
{
User user;
userService = UserService::getInstance();
userService->getCurrentUser(user);
// userService->getUser("b2",user);
lblDOB = new QLabel(user.getDOB());
lblFirstname = new QLabel(user.getFirstName());
lblLastname = new QLabel(user.getLastName());
lblUsername = new QLabel(user.getUsername()); |
cpp | rank_cnt[ rank[i] ] ++;
for(int i = 1; i <= Max_char; i++)
rank_cnt[i] += rank_cnt[i - 1];
for(int i = len; i > 0; i--){
sa[ rank_cnt[ rank[ tp[i] ] ] -- ] = tp[i]; |
cpp | #include <gtest/gtest.h>
#include <test/unit/math/rev/scal/util.hpp>
#include <vector>
namespace test {
void check_varis_on_stack(const std::vector<stan::math::var>& x) {
for (size_t n = 0; n < x.size(); ++n)
EXPECT_TRUE(stan::math::ChainableStack::memalloc_.in_stack(x[n].vi_))
<< n << " is not on the stack";
} |
cpp | v1.erase(v1.begin());
cout<<a<<" "<<v1.size()<<endl;
}
else
{cout<<"-1 "<<0<<endl;}}
else if(inp=='E')
{ lli temp;
cin>>temp;
v1.push_back(temp);
cout<<v1.size()<<endl; |
cpp | QMainWindow(parent),
ui(new Ui::CameraCalibration)
{
ui->setupUi(this);
this->setFixedSize(940,840);
w1 = new First(this);
w2 = new Second(this);
QObject::connect(w2,SIGNAL(show_step1()),w1,SLOT(receive_step2()));
QObject::connect(w1,SIGNAL(show_step2()),w2,SLOT(receive_step1())); |
cpp | return Time();
int btime;
if (!StringToInt(btime_it->second, &btime))
return Time();
return Time::FromTimeT(btime);
}
TimeDelta ClockTicksToTimeDelta(int clock_ticks) {
// This queries the /proc-specific scaling factor which is
// conceptually the system hertz. To dump this value on another
// system, try
// od -t dL /proc/self/auxv
// and look for the number after 17 in the output; mine is |
cpp |
mMap->update();
if ( mEnabled && mVisible && isMouseOver() ) {
Uint32 Flags = getEventDispatcher()->getClickTrigger();
if ( EDITING_LIGHT == mEditingMode ) {
if ( NULL != mSelLight ) {
if ( Flags & EE_BUTTONS_WUWD ) { |
cpp | #include "PlayerEntity.hpp"
#include "TerrainGenerator.hpp"
#include "NovelGameSystem.hpp"
class TestScene :public Scene {
public:
const string getSceneName() override {
return "TestScene"; |
cpp | interface IConstEnvironment;
//---------------------------------------------------------------------------
// Function prototypes
//---------------------------------------------------------------------------
extern DEPLOYUTILS_API IPropertyTree *loadInstallSet(IPropertyTree *pBuild, IPropertyTree *pBuildSet, IConstEnvironment* pConstEnv);
extern DEPLOYUTILS_API IPropertyTree *loadSchema(IPropertyTree *pBuild, IPropertyTree *pBuildSet, StringBuffer& sSchemaPath, IConstEnvironment* pConstEnv);
IPropertyTree *loadDefaultSchema();
extern DEPLOYUTILS_API bool connectBuildSet(IPropertyTree* pBuild, IPropertyTree* pBuildSet, StringBuffer& buildSetPath, IConstEnvironment* pConstEnv);
//---------------------------------------------------------------------------
#endif // !defined(AFX_DEPLOYUTILS_BUILDSET_HPP__INCLUDED_) |
cpp |
#include "print.tcc"
#include "tuple.tcc"
#include "vector.tcc"
//! \defgroup write
|
cpp |
if (orientation() == Qt::Vertical)
{
pressedPos = minimum() + ((maximum() - minimum()) * (height() - event->y())) / height();
}
else
{
pressedPos = minimum() + ((maximum() - minimum()) * event->x()) / width();
}
setValue(pressedPos); |
cpp | #include <QDomElement>
#include <QDomDocument>
#include <QDomAttr>
#include <QDebug>
#include "geometrySet.h"
#include "geometryData.h"
|
cpp | m_regs[8], m_regs[8],
m_regs[9], m_regs[9],
m_regs[10], m_regs[10],
m_regs[11], m_regs[11],
m_regs[12], m_regs[12], |
cpp | *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
cpp | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* |
cpp | return speed_cost;
}
// Determine cost for lane change and heavily penalise for illegal maneuver
double BehaviourStateMachine::LaneChangeCost(int& lane, int& current_lane)
{
double lane_cost;
if (lane < -0.001 || lane > 2.001)
{
lane_cost = 1.0;
}
else if ((current_lane == 0) && (lane == 1))
{ |
cpp | //β Includes β
//ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
#pragma region [Includes]
#include<glm/glm.hpp>
#include "aabb.h"
#pragma endregion [Includes]
|
cpp | }
};
template<typename Log, typename... Args>
pusher_t<Log>
make_pusher(Log& log, record_t& record, Args&&... args) {
return pusher_t<Log>(log, record, std::forward<Args>(args)...);
}
|
cpp | #define nl '\n'
struct Node{
int value;
struct Node *next,*prev;
};
|
cpp |
Uint16 UNIX_iSCSIConnectionSettings::getSecondaryDataDigestMethod() const
{
return Uint16(0);
}
|
cpp | #include "Vector2D.h"
Vector2D Vector2D::operator+(Vector2D another) const
{
return { this->x + another.x, this->y + another.y };
} |
cpp |
_Constants::numf_F3=SIMD<_SIMDType>::set(1.f/3.f);
_Constants::numf_G3=SIMD<_SIMDType>::set(1.f/6.f);
_Constants::numf_R3=SIMD<_SIMDType>::set(2.f/3.f);
_Constants::numf_G33=SIMD<_SIMDType>::set((3.f/6.f)-1.f);
_Constants::numf_hash2Float=SIMD<_SIMDType>::set(1.f/2147483648.f);
_Constants::numf_vectorSize=SIMD<_SIMDType>::set((float)SIMD<_SIMDType>::vectorSize());
_Constants::numf_cubicBounding=SIMD<_SIMDType>::set(1.f/(1.5f*1.5f*1.5f));
_Constants::numi_1=SIMD<_SIMDType>::set(1);
_Constants::numi_2=SIMD<_SIMDType>::set(2);
_Constants::numi_255=SIMD<_SIMDType>::set(255);
_Constants::numi_60493=SIMD<_SIMDType>::set(60493);
_Constants::numi_0x7fffffff=SIMD<_SIMDType>::set(0x7fffffff);
|
cpp |
// Erode
erode->SetMarkerImage ( shiftErode->GetOutput() );
erode->SetMaskImage ( dilate->GetOutput() );
erode->FullyConnectedOn();
writer->SetInput ( erode->GetOutput() );
itk::SimpleFilterWatcher watchDilate(dilate);
itk::SimpleFilterWatcher watchErode(erode);
// Execute the filter
try |
cpp | board[i][j]->_player != board[location.first][location.second]->_player ){
long CurrDis = sqrt(pow(i - location.first,2) + pow(j - location.second,2));
if (CurrDis < MinDistance) {
MinDistance = CurrDis;
ToAttack = {i,j};
}
}
}
}//need if not have enemy soldier
if(MinDistance != pow(board.size(),2)){
board[ToAttack.first][ToAttack.second]->_points -= board[location.first][location.second]->_ability; |
cpp | }
break;
}
}
cout << "create server" << endl;
servercore* myServer = new servercore(port, dir, commandOffset); // create server |
cpp |
#include <gm/functions/inverse.h>
#include <gm/functions/matrixProduct.h>
template < typename MatrixT >
void CHECK_INVERSE( const MatrixT& i_matrix )
{
MatrixT identity;
gm::SetIdentity( identity );
MatrixT inverse;
CHECK( gm::Inverse( i_matrix, inverse ) );
CHECK( gm::MatrixProduct( i_matrix, inverse ) == identity );
CHECK( gm::MatrixProduct( inverse, i_matrix ) == identity ); |
cpp | private:
// Use an opaque pointer to avoid the need for popart headers
std::unique_ptr<popart::ConstVoidData> _data;
};
// A class to store a constant which is simply returned, (possibly in a tuple
// or list) and is not inserted into Popart
class HostSideConstant {
public:
HostSideConstant(const PopartType &popart_type, void *data, size_t data_size,
std::vector<std::int64_t> shape);
PopartType popartType() const { return _popart_type; }
const std::vector<std::int64_t> &shape() const { return _shape; } |
cpp |
e1 = Domain("a");
e1.narrow_with(Domain({"a", "b"}));
EXPECT_THAT(e1.elements(), ::testing::UnorderedElementsAre("a"));
EXPECT_FALSE(e2.is_top()); |
cpp | }
catch (const std::exception& ex) {
apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
ex, std::move(req), ctx, eb, "do_mid");
return; |
cpp | , mtx_ ()
, cloud_ ()
{
}
/**
* @brief Callback method for the grabber interface
* @param cloud The new point cloud from Grabber
*/
void
cloud_cb_ (const CloudConstPtr& cloud) |
cpp | public:
int m;
int n;
};
int main()
{
list<clase> lista; |
cpp | const uint16_t CENTER_Y = 100;
const uint16_t RADIUS = 80;
static ImageAnimatorInfo g_imageAnimatorInfo[4] = {
{GREEN_IMAGE_PATH, {50, 50}, 94, 94, IMG_SRC_FILE_PATH},
{YELLOW_IMAGE_PATH, {50, 50}, 94, 94, IMG_SRC_FILE_PATH}, |
cpp | // is not in a register, but it is on the stack in the marker spill slot.
LinkageLocation target_loc = is_osr
? LinkageLocation::ForSavedCallerFunction()
: regloc(kJSFunctionRegister);
return new (zone) CallDescriptor( // --
CallDescriptor::kCallJSFunction, // kind
target_type, // target MachineType
target_loc, // target location
types.Build(), // machine_sig |
cpp | int share = _max_warehouses() / total_cpus;
if (_max_warehouses() % total_cpus != 0) {
K2LOG_W(log::tpcc, "CPUs {} must divide evenly into num warehouses {}!", total_cpus, _max_warehouses());
return seastar::make_exception_future(std::runtime_error("Unable to load data due to CPU/warehouse mismatch"));
}
auto f = seastar::make_ready_future<>();
if (_global_id == 0) {
f = f.then ([this] {
K2LOG_I(log::tpcc, "Creating primary collection");
dto::CollectionMetadata metadata{
.name = tpccCollectionName,
.hashScheme = dto::HashScheme::Range,
.storageDriver = dto::StorageDriver::K23SI, |
cpp | #include <boost/beast/http/parser.hpp>
#include <boost/beast/http/empty_body.hpp>
namespace foxy
{
template <typename Allocator = std::allocator<char>>
using header_parser =
boost::beast::http::request_parser<
boost::beast::http::empty_body, Allocator>; |
cpp | wxHtmlOpeningStatus
wxHtmlListBox::OnHTMLOpeningURL(wxHtmlURLType WXUNUSED(type),
const wxString& WXUNUSED(url),
wxString *WXUNUSED(redirect)) const
{
return wxHTML_OPEN;
}
wxPoint wxHtmlListBox::HTMLCoordsToWindow(wxHtmlCell *cell,
const wxPoint& pos) const
{
return CellCoordsToPhysical(pos, cell);
}
|
cpp |
namespace boost {
namespace beast {
namespace detail {
//------------------------------------------------------------------------------
//
// get_lowest_layer
// lowest_layer_type
// detail::has_next_layer
//
template <class T>
std::false_type has_next_layer_impl(void*);
|
cpp | basic::Vector3 camera_translation = camera.GetNode().GetTransform().GetMatrix(
scene::TRS_Local, scene::TRS_World).GetTranslation();
basic::Vector3 node_translation = node.GetTransform().GetMatrix(
scene::TRS_Local, scene::TRS_World).GetTranslation();
real distance = camera_translation.GetDistance(node_translation);
|
cpp |
uint32_t ret = 0;
do {
// See if the type is already in our ASTContext.
clang::ASTContext *ast_ctx = m_ast_ctx.getASTContext();
clang::IdentifierInfo &identifier_info =
ast_ctx->Idents.get(name.GetStringRef());
clang::DeclarationName decl_name =
ast_ctx->DeclarationNames.getIdentifier(&identifier_info);
clang::DeclContext::lookup_result lookup_result =
ast_ctx->getTranslationUnitDecl()->lookup(decl_name); |
cpp | namespace halina {
class Servo {
public:
Servo() = default;
virtual void init() = 0;
virtual void set(float position) = 0;
};
}
|
cpp | this->spMIC->SetPosition(thisRect.left, thisRect.top, thisRect.right, thisRect.bottom);
return this->spMIC->SetOwnerWindow((LONG_PTR)hWnd);
}
HRESULT MathInput::Show()
{
return this->spMIC->Show(); |
cpp | std::string get(std::string const& option) const;
/**
* Sets the value of the specified option.
*
* \param[in] option
* \param[in] value
*/
void set(std::string const& option, std::string const& value); |
cpp | if (kind == GeneratorKind::SetGenerator)
prefix = "set-";
string s;
for (auto &i : loops) {
string q;
for (auto &k : i.conds)
q += format(" (if {})", k->toString());
s += format(" (for {} {}{})", i.vars->toString(), i.gen->toString(), q);
} |
cpp | int returnValue = EXIT_SUCCESS;
typedef T TPixelType;
const unsigned char DIMENSION = 3;
typedef itk::Image< TPixelType, DIMENSION > HeatFlowImageType;
// Read heatflow image
typedef itk::ImageFileReader< HeatFlowImageType > HeatFlowReaderType;
typename HeatFlowReaderType::Pointer heatFlowReader = HeatFlowReaderType::New();
heatFlowReader->SetFileName( heatFlowImage.c_str() );
heatFlowReader->Update();
|
cpp | auto continous = scale.continousName(*setter->getTable());
if (!continous.empty()) list.push_front(continous);
return Text::toJSon(list);
}
else if (property == "stackable")
{
return Conv::toString(scale.stackable());
} |
cpp | //std::cout << "var1: " << var1 << ", var2: " << var2 << std::endl;
EXPECT_EQ ( true, var2.equal(var1,0.1) );
}
*/
TEST_F ( ObjectTest, serializePlaneEquation ) {
std::string filename ( "/tmp/planeEquation.xml" );
ShmFw::PlaneEquation<> var1, var2;
var1.rand ( -10, 10 ); |
cpp | #include <PLCore/Tools/Timing.h>
#include "PLScene/Scene/SceneContext.h"
#include "PLScene/Scene/SceneNodeModifiers/SNMDeactivationOnTimeout.h"
//[-------------------------------------------------------]
//[ Namespace ]
//[-------------------------------------------------------]
using namespace PLCore;
namespace PLScene {
//[-------------------------------------------------------]
//[ RTTI interface ] |
cpp | inline void set_textInfo_12(TextInfo_t5F1E697CB6A7E5EC80F0DC3A968B9B4A70C291D8 * value)
{
___textInfo_12 = value;
Il2CppCodeGenWriteBarrier((&___textInfo_12), value);
}
inline static int32_t get_offset_of_m_name_13() { return static_cast<int32_t>(offsetof(CultureInfo_t345AC6924134F039ED9A11F3E03F8E91B6A3225F, ___m_name_13)); }
inline String_t* get_m_name_13() const { return ___m_name_13; }
inline String_t** get_address_of_m_name_13() { return &___m_name_13; } |
cpp | }
void TestAppending(const HWC& append, const BHWC& output_shape,
std::vector<float>&& expected) {
TestPadOperation(HWC(0, 0, 0), append, output_shape, std::move(expected));
}
} // namespace
TEST(PadTest, PrependH) {
TestPrepending(/*prepend=*/HWC(1, 0, 0),
/*output_shape=*/BHWC(1, 2, 1, 1), /*expected=*/{0, 1}); |
cpp | std::cerr << "Cannot evaluate " << in << ": " << re.what() << std::endl;
else if (!kQuiet)
std::cout << "Cannot evaluate due to error" << std::endl;
}
}
}
auto EnterShellMode(const std::string &prompt) -> int {
GenerateVocabulary();
if (!kQuiet)
ShowBanner();
|
cpp | // Searches for the file(s) in the argument in the standard path
// as defined in ComPathNameSearch.cc. The full name of the resolved
// file is written to stdout. If one of more files are not found,
// a return value of ENOENT (2 on Solaris) is returned.
//
// Environment:
// Software developed for the BaBar Detector at the SLAC B-Factory.
//
// Author List:
// <NAME> Original Author
// |
cpp | merge_type how = merge_type::merge_duplicate) -> void;
auto get_rules(void) const -> const auto & {
return rules;
}
|
cpp | return 0;
}
int
ArrayDeviceList::RemoveSpare(ArrayDevice* target)
{
unique_lock<mutex> lock(*mtx);
auto it = FindSpare(target);
if (it == devSet_.spares.end()) |
cpp | std::vector<node_id_t> filtered_joiners(curr_view->joined.size() - 1);
std::remove_copy(curr_view->members.begin(), curr_view->members.end(),
filtered_members.begin(), failed_joiner_id);
std::remove_copy(curr_view->member_ips_and_ports.begin(),
curr_view->member_ips_and_ports.end(),
filtered_ips_and_ports.begin(),
curr_view->member_ips_and_ports[curr_view->rank_of(failed_joiner_id)]);
std::remove_copy(curr_view->joined.begin(), curr_view->joined.end(),
filtered_joiners.begin(), failed_joiner_id);
curr_view = std::make_unique<View>(0, filtered_members, filtered_ips_and_ports,
std::vector<char>(curr_view->num_members - 1, 0), filtered_joiners, |
cpp |
if(fin.is_open())
isExist = true;
fin.close();
return isExist;
} |
cpp | }
sort(arr_tiny->begin(), arr_tiny->end());
std::ifstream fin_large;
fin_large.open("data.largeW.txt");
if (!fin_large){
std::cout<<"I/O error"<<endl;
throw "I/O error"; |
cpp | #include "roclapack_sytrf.hpp"
template <typename T, typename U>
rocblas_status rocsolver_sytrf_batched_impl(rocblas_handle handle,
const rocblas_fill uplo, |
cpp | }
_localWorkSize[0] = lx;
_localWorkSize[1] = ly;
return this;
}
KernelLauncher* KernelLauncher::pLocal(const int lx, const int ly, const int lz) { |
cpp | * -------------------------------------------------------------------
*/
/****************************************************************************************
Portions of this file are derived from the following 3GPP standard:
|
cpp | } catch (...) {
assert(false);
}
assert(throws_on_move::count == 1);
}
assert(throws_on_move::count == 0);
#endif
}
template <class Type>
void test_copy_move_value() {
// constructing from a small type should perform no allocations.
DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
assert(Type::count == 0);
Type::reset(); |
cpp | Engine engine;
//engine.start();
engine.startWithLogs();
return 0;
}
|
cpp |
// append chunk to buffer
m_vBufferedSamples.insert(std::end(m_vBufferedSamples), std::begin(chunk), std::end(chunk));
// check if we can output another block
if(m_vBufferedSamples.size() >= m_iOutputBlockSize) {
Eigen::MatrixXd matOutput(m_StreamInfo.channel_count(), m_iOutputBlockSize);
// copy samples
for(int iSampleIdx = 0; iSampleIdx < m_iOutputBlockSize; ++iSampleIdx) { |
cpp | template <typename T>
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> corr_matrix_constrain(
const Eigen::Matrix<T, Eigen::Dynamic, 1>& x,
typename math::index_type<Eigen::Matrix<T, Eigen::Dynamic, 1> >::type k) {
using Eigen::Dynamic;
using Eigen::Matrix;
typedef typename index_type<Matrix<T, Dynamic, 1> >::type size_type;
size_type k_choose_2 = (k * (k - 1)) / 2;
check_size_match("cov_matrix_constrain", "x.size()", x.size(), "k_choose_2",
k_choose_2);
Eigen::Array<T, Eigen::Dynamic, 1> cpcs(k_choose_2);
for (size_type i = 0; i < k_choose_2; ++i)
cpcs[i] = corr_constrain(x[i]); |
cpp | NiceMock<Runtime::MockRandomGenerator> random;
ON_CALL(random, random()).WillByDefault(Return(27));
JitteredBackOffStrategy jittered_back_off(25, 30, random);
EXPECT_EQ(2, jittered_back_off.nextBackOffMs());
EXPECT_EQ(27, jittered_back_off.nextBackOffMs());
|
cpp | // Self-aware export.
class ImageExporter {
public:
// Chooses correct format based on given extension.
static void save(const Image&, const std::string&);
};
// Binary PPM Image Format. |
cpp | {
return;
}
//implement GApplicationWindowCallback
/*virtual*/ void PlayWithGoldfishStateWindowCallback::OnResize(const GVector2Int& in_size) |
cpp |
// Find
{
Database db;
db.Add({ 2019, 1, 1 }, "e1");
db.Add({ 2019, 1, 1 }, "e2");
db.Add({ 2018, 1, 7 }, "e3");
db.Add({ 2018, 1, 7 }, "e4");
std::istringstream is("date == 2018-01-07");
auto const condition = ParseCondition(is);
auto predicate = [condition](const Date& date, const std::string& event)
{ |
cpp | #include "common/typecase.h"
#include "core/Names.h"
using namespace std;
|
cpp | m_domainNameHasBeenSet = true;
}
if(jsonValue.ValueExists("domainNameConfigurations"))
{
Array<JsonView> domainNameConfigurationsJsonList = jsonValue.GetArray("domainNameConfigurations");
for(unsigned domainNameConfigurationsIndex = 0; domainNameConfigurationsIndex < domainNameConfigurationsJsonList.GetLength(); ++domainNameConfigurationsIndex)
{ |
cpp |
Point reproduce(const oatpp::Object<PointDto> &value) const override {
return Point({value->x, value->y, value->z});
}
};
|
cpp | REQUIRE(constant->eval() == 123);
}
TEST_CASE("test_constant_decimal", "[ConstantReactor]") {
auto constant = make_constant_reactor(3.14);
REQUIRE(constant->commit(100) == BaseReactor::Update::COMPLETE_EVAL);
REQUIRE(constant->eval() == 3.14);
}
TEST_CASE("test_constant_string", "[ConstantReactor]") {
auto constant = make_constant_reactor("hello world"s);
REQUIRE(constant->commit(123) == BaseReactor::Update::COMPLETE_EVAL);
REQUIRE(constant->eval() == "hello world"s);
}
|
cpp | NANO_CASE(construct_point)
{
for (const auto& xy : {
std::make_tuple<nano::coord_t>(+3, +7),
std::make_tuple<nano::coord_t>(+7, +3),
std::make_tuple<nano::coord_t>(-5, -1),
std::make_tuple<nano::coord_t>(-9, +1)})
{
const auto x = std::get<0>(xy);
const auto y = std::get<1>(xy);
const nano::point_t point(x, y);
|
cpp | * This is free software. See 'LICENSE' for details.
* You must read and accept the license prior to use.
*
* Author: <NAME>
*/
#ifndef _SK_UTIL_PROCESSOR_REJECTING_HXX_
#define _SK_UTIL_PROCESSOR_REJECTING_HXX_
#include <sk/util/Processor.h>
#include <sk/util/Selector.h> |
cpp | const u32arr_type res = lexical_cast<u32arr_type>(val);
BOOST_CHECK(&res[0] == u32ethalon);
}
BOOST_CHECK_THROW(lexical_cast<u32short_arr_type>(val), boost::bad_lexical_cast);
#endif
} |
cpp | lua_replace(ls, value_idx);
rollsize = this_weight;
}
lua_pop(ls, 1);
}
lua_pushvalue(ls, value_idx);
return 1;
}
static int crawl_err_trace(lua_State *ls)
{ |
cpp | #include <cstddef>
#include <iostream>
#include <map>
template< typename ID, typename F >
inline region_graph_ptr<ID,F>
get_region_graph( const affinity_graph_ptr<F>& aff_ptr,
const volume_ptr<ID> seg_ptr,
std::size_t max_segid)
{
std::ptrdiff_t xdim = aff_ptr->shape()[0]; |
cpp | }
delete this->Private;
}
//------------------------------------------------------------------------------
void vtkSQLiteQuery::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "Statement: ";
if (this->Private->Statement)
{ |
cpp | //
// MCLibetpan.cpp
// mailcore2
//
// Created by <NAME> on 6/28/13.
// Copyright (c) 2013 MailCore. All rights reserved.
//
#include "MCLibetpan.h"
#include <libetpan/libetpan.h>
|
cpp | // Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "MultiBreakpong.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, MultiBreakpong, "MultiBreakpong" );
DEFINE_LOG_CATEGORY(LogMultiBreakpong)
|
cpp | void SkeletalModel::load(const char *skeletonFile, const char *meshFile, const char *attachmentsFile)
{
loadSkeleton(skeletonFile);
m_mesh.load(meshFile);
m_mesh.loadAttachments(attachmentsFile, m_joints.size());
computeBindWorldToJointTransforms();
updateCurrentJointToWorldTransforms();
}
void SkeletalModel::draw(Matrix4f cameraMatrix, bool skeletonVisible)
{
|
cpp | } // namespace
std::unique_ptr<mlir::FunctionPass> CreateDetensorizeLinalgPass() {
return std::make_unique<DetensorizeLinalgPass>();
} |
cpp |
auto Err = (*Alloc)->finalize();
EXPECT_THAT_ERROR(std::move(Err), Succeeded());
ExecutorAddr TargetAddr((*Alloc)->getTargetMemory(sys::Memory::MF_READ));
|
cpp | }
}
void UltrasonicLite::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1]; |
cpp |
class QRelu final : public c10::OperatorKernel {
public:
Tensor operator()(Tensor qx) {
Tensor qy;
const auto zero_point = qx.q_zero_point();
AT_DISPATCH_QINT_TYPES(qx.scalar_type(), "qrelu", [&]() {
qy = at::_empty_affine_quantized(qx.sizes(),
at::device(kCPU).dtype(SCALAR_TYPE),
qx.q_scale(),
qx.q_zero_point());
auto iter = TensorIterator::unary_op(qy, qx); |
cpp |
float current_length = braces_length;
for(typename std::vector<T>::const_iterator element_it = array.cbegin(); element_it != array.cend(); element_it++) {
const std::string & s_element = stringify_func(*element_it);
float value_length = XPLMMeasureString(xplmFont_Proportional, s_element.c_str(), s_element.size());
|
cpp |
public:
InstViewModel(MonitorBackend&, SelectedItemViewModel&);
explicit operator bool() const noexcept {
return bool(_inst.id()); |
cpp | if (string_count != 2)
MaxWordLength(str1, max_length);
string_count++;
printf("%s", &str1);
}
}
}
}
|
cpp | int index = tblMailView->currentIndex().row();
if (index >= 0 && index < mailModel->getData().count()) {
return mailModel->getData().at(index);
}
else {
return NULL;
} |
cpp | schemaParser.populateSchema(schemaAdapter, schema);
auto targetDoc = json::parse(targetJson, ec);
if (ec) {
std::cerr << "Error parsing target json: " << ec.message() << std::endl;
return 1;
}
valijson::Validator validator;
valijson::ValidationResults results;
valijson::adapters::BoostJsonAdapter targetAdapter(targetDoc);
if (validator.validate(schema, targetAdapter, &results)) { |
cpp | }
// Go to appropriate descriptor
D3D12_CPU_DESCRIPTOR_HANDLE handle(m_MainDescriptorHeap.Heap->GetCPUDescriptorHandleForHeapStart());
handle.ptr += static_cast<uint32_t>(slot) * m_Device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
m_Device->CreateShaderResourceView(
|
cpp | bottom = -5;
left = -5;
top = 5;
right = 5;
projectionMatrix = glm::perspective(RADIANS(fov), window->props.aspectRatio, 0.01f, 200.0f);
isOrtho = false; |
cpp | while (parser.look(Token::Type::Comma)) {
(void)parser.consume(Token::Type::Comma);
expressions_.push_back(Expression::parse(parser));
}
(void)parser.consume(Token::Type::EndOfString); |
cpp | return "\x1b[31;1mSaveLayer\x1b[0m"; // Bold red.
}
int fDigits;
int fIndent;
int fIndex;
SkRecords::Draw fDraw;
};
int main(int argc, char** argv) {
CommandLineFlags::Parse(argc, argv);
for (int i = 0; i < FLAGS_skps.count(); i++) {
if (CommandLineFlags::ShouldSkip(FLAGS_match, FLAGS_skps[i])) {
continue; |
cpp | int main(){
SLAY
int _=1 , tc=1;
ll n,m;
int cnt[100001];
cin>>_;
while(_--){
ll mx =0,ans=0,ones=0;
cin>>n;
vector<int>v(n);
vector<int> p;
set<int> s;
for(int i=0;i<n;i++){ |
cpp | float sy = sinf(z);
m[0] = cp * cy;
m[1] = cp * sy;
m[2] = -sp;
float srsp = sr * sp;
float crsp = cr * sp;
m[4] = srsp * cy - cr * sy;
m[5] = srsp * sy + cr * cy;
m[6] = sr * cp;
m[8] = crsp * cy + sr * sy;
m[9] = crsp * sy - sr * cy; |
cpp | // ================================================================================
#include "tb_object.h"
#include <assert.h>
namespace tb {
|
cpp | if (readRegister(LSM9DS1_ADDRESS, 0x2F) & 63) {
return 1;
}
} else {
if (readRegister(LSM9DS1_ADDRESS, LSM9DS1_STATUS_REG) & 0x01) {
return 1;
}
}
return 0; |
cpp | tl_ = v_points[i];
tl_.x += offset;
tl_.y += offset;
}
else
{
bl_ = v_points[i];
bl_.x += offset;
bl_.y -= offset;
}
}
else
{
if (v_points[i].y < rr_.center.y) |
cpp | notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the author or Destrat.io nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
Subsets and Splits