lang
stringclasses 10
values | seed
stringlengths 5
2.12k
|
---|---|
cpp | #include <algorithm>
using namespace std;
long long rnum, f[32] = {1};
int main() {
for (int i = 1; i < 32; i++) // f[n] = sigma(C(n, i) * i!) = f[n-1] * n + 1;
f[i] = f[i-1] * i + 1;
char s[32], dictionary[32];
int nextTest;
scanf("%s", s);
do {
int n = strlen(s), used[26] = {}; |
cpp | return "map";
case MincStructType:
return "struct";
}
return NULL;
}
static int score_line_offset = 0; |
cpp | // Code generated by the SmartSoft MDSD Toolchain
// The SmartSoft Toolchain has been developed by:
//
// Service Robotics Research Center
// University of Applied Sciences Ulm
// Prittwitzstr. 10
// 89075 Ulm (Germany) |
cpp | HistoryTree::HistoryTree() : Tree<Pair<std::shared_ptr<Observation>, std::shared_ptr<Action>>>()
{
}
HistoryTree::HistoryTree(number max_depth) : Tree<Pair<std::shared_ptr<Observation>, std::shared_ptr<Action>>>(max_depth)
{
}
HistoryTree::HistoryTree(std::shared_ptr<HistoryTree> parent, const Pair<std::shared_ptr<Observation>, std::shared_ptr<Action>> &item) : Tree<Pair<std::shared_ptr<Observation>, std::shared_ptr<Action>>>(parent, item)
{
}
std::shared_ptr<HistoryInterface> HistoryTree::getPreviousHistory()
{ |
cpp | return mode_;
}
void TensorCtx::fixKey(int key) {
if (keyFixed()) throw std::runtime_error("TensorCtx key is fixed");
key_ = key;
}
void TensorCtx::unfixKey() {
key_ = -1;
}
bool TensorCtx::keyFixed() const {
return key_ != -1;
} |
cpp | if(NULL == ppvObject)
{
hr = E_POINTER;
}
else
{
*ppvObject = NULL;
}
if(SUCCEEDED(hr))
{
|
cpp | return OnGetFriendlyName_Internal<EMCsAIState>(EnumIndex);
}
FText SCsGraphPin_ECsAIState::OnGetTooltip(int32 EnumIndex)
{
return OnGetTooltip_Internal<EMCsAIState>(EnumIndex);
}
|
cpp | bool isPowerOfTwo(int n) {
while(n > 0)
{
if (n == 1)
return true;
if (n % 2 != 0)
return false;
n /= 2;
}
return false;
}
}; |
cpp | cout << "* Considering dropout:" << '\n';
cout << " - dropout at 1.0x metadata overhead" << '\n';
cout << " | equiv.bitlen:\t" << dropout_equiv_bitlen_2x << '\n';
cout << " | reduction rate:\t" << (equiv_origin_bitlen / dropout_equiv_bitlen_2x) << '\n';
cout << " | bitlen_dropout <= bitlen_enc?\t"
<< (dropout_equiv_bitlen_2x <= compressibility.huffman_est.avg_bitlen_lower_bound) << '\n';
cout << " - dropout at 0.5x metadata overhead" << '\n';
cout << " | equiv.bitlen:\t" << dropout_equiv_bitlen_1_5x << '\n';
cout << " | reduction rate (fp32):\t" << (equiv_origin_bitlen / dropout_equiv_bitlen_1_5x) << '\n';
cout << " | bitlen_dropout <= bitlen_enc?\t" |
cpp | #include <bitset>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstring>
#include <string> |
cpp |
}// namespace linalg_internal
}// namespace cytnx
|
cpp | for (Variant chunk = HHVM_FN(fread)(f.toResource(), 1024);
!is_empty_string(chunk.asTypedValue());
chunk = HHVM_FN(fread)(f.toResource(), 1024)) {
String schunk = chunk.toString();
ops->hash_update(context, (unsigned char *)schunk.data(), schunk.size());
}
} else {
ops->hash_update(context, (unsigned char *)data.data(), data.size()); |
cpp | #endif
}
uint64_t GCSFilter::HashToRange(const Element& element) const
{
uint64_t hash = CSipHasher(m_siphash_k0, m_siphash_k1)
.Write(element.data(), element.size())
.Finalize();
return MapIntoRange(hash, m_F); |
cpp | int n,rev,d;
cout<<"Enter the number to be checked\n";
cin>>n;
int n1=n;
int ch=checkprime(n);
rev=0;
while(n!=0) |
cpp | static const char* _dbPropertyValues[];
static const char* _dbStateVarValues[];
static const PylithScalar _dbProperties[];
static const PylithScalar _dbStateVars[];
static const PylithScalar _properties[];
|
cpp | auto json_syntax_error = [](auto error) {
io::fatal(status_code::syntax_error,
"{{\n"
" \"result\": \"ERROR\",\n"
" \"error\": \"{}\"\n"
"}}", error);
};
if(!cli::output_format || cli::output_format == "readable")
return readable_syntax_error;
return json_syntax_error; |
cpp | } else if (sizeof(long) <= sizeof(long long)) {
return PyLong_FromLongLong((long long) value);
}
}
{ |
cpp | data_buff[i] = (i < inner) ? input[(i * box_size) + 4] : std::numeric_limits<T>::max();
index_buff[i] = i;
}
};
CPUKernelUtils::ParallelFor(task1, ceil_power2);
for (size_t i = 2; i <= static_cast<size_t>(ceil_power2); i <<= 1) {
for (size_t j = (i >> 1); j > 0; j >>= 1) {
auto task2 = [&](size_t start, size_t end) {
for (size_t tid = start; tid < end; tid++) {
size_t tid_comp = tid ^ j;
if (tid_comp > tid) { |
cpp |
fflush(file2);
pclose(file2);
free(p);
free(e);
return 0;
} |
cpp |
while (succ && succ->left)
prev = exchange(succ, succ->left);
if (succ)
succ->left = root->left;
else
succ = root->left; |
cpp |
if( hist_type == CV_HIST_ARRAY )
v = ptr[i];
else
{
v = (float)cvGetRealND( sparse, indices.ptr<int>() + i*cdims );
cvClearND( sparse, indices.ptr<int>() + i*cdims );
} |
cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
#include <unistd.h> |
cpp | DllExport void swGraphicsRenderSolidArcs4(float x,float y,float w,float h,int count, float rot, swPoint *weight, float startAngle,float stopAngle){
float dX=-(w*(weight->x-0.5f)+x);
float dY=-(h*(weight->y-0.5f)+y);
glPushMatrix();
swGraphicsUpdateModelMatrix(-dX,-dY,rot);
glBegin(GL_POLYGON); |
cpp |
void initAdditionalGlobalMMIO(const CommandStreamReceiver &commandStreamReceiver, AubMemDump::AubStream &stream) {}
uint64_t getPPGTTAdditionalBits(GraphicsAllocation *graphicsAllocation) {
return 0;
}
void adjustAubGTTData(const CommandStreamReceiver &commandStreamReceiver, AubGTTData &data) {} |
cpp | std::allocator<T> a;
test_max<T> (a.max_size() + 1); // just barely too large
test_max<T> (a.max_size() * 2); // significantly too large
test_max<T> (((size_t) -1) / sizeof(T) + 1); // multiply will overflow
test_max<T> ((size_t) -1); // way too large
}
|
cpp |
#include "realm/util/functional.hpp"
#include "test.hpp"
namespace realm::util {
namespace {
struct MoveOnlyType {
MoveOnlyType() noexcept = default;
MoveOnlyType(MoveOnlyType&& other)
: moved_from(false)
, moved_to(true)
{ |
cpp | const vx::SharedFunPtr<void(const QSharedPointer<ResultError>& result)>&
fun) {
onFinished(obj, [fun](const QSharedPointer<ResultError>& result) {
if (result) fun(result);
});
}
void Operation::onFinishedSuccess(QObject* obj,
const vx::SharedFunPtr<void()>& fun) {
onFinished(obj, [fun](const QSharedPointer<ResultError>& result) {
if (!result) fun();
});
} |
cpp |
unsigned char read() { return *cur++; }
unsigned char peek() const { return *cur; }
};
typedef std::vector<Feature> Features;
int main(int argc, char** argv) {
if(argc != 3) {
std::cerr << "Usage: mkmimic <index> <model-file>" << std::endl;
return 1;
}
CharStreamVector csv(argv[2]); |
cpp | mBasePtr = ptr;
#endif // !defined(__MINGW32__)
mFileName = origFileName != NULL ? strdup(origFileName) : NULL;
mBaseLength = adjLength;
mDataOffset = offset;
mDataPtr = (char*) mBasePtr + adjust;
mDataLength = length;
assert(mBasePtr != NULL);
ALOGV("MAP: base %p/%zu data %p/%zu\n", |
cpp | unique_ptr<mat> _w;
shared_ptr<vec> _eta;
int _nVals;
shared_ptr<vec> _nls_wpp;
shared_ptr<vec> _nls_w1pp;
shared_ptr<vec> _nls_w2pp;
}; |
cpp | {
int a = ringDivF(i, 0);
int b = ringDivF(i, 1);
int c = ringDivF(i, 2);
auto boundaryCounter = [&](int i){
return (int)isBoundary.coeffRef(i)>0;
}; |
cpp | colortext[] = {0,0,0,0.7};
text ="";
};
};
|
cpp | uint64_t member1;
double member2;
TestStruct() = default;
TestStruct(uint64_t __member1, double __member2)
: member1(__member1),
member2(__member2)
{}
};
Utils::ObjectPool<TestStruct> memory_pool(4, 2);
for(int i =0; i < 6; i++) {
Utils::ObjectPool<TestStruct>::Ptr ptr = memory_pool.allocate(i, i + 10);
ASSERT_NE(ptr.get(), nullptr);
ASSERT_EQ((ptr.get()->member1), i);
ASSERT_EQ((ptr.get()->member2), i+ 10); |
cpp | #include "Application.h"
#include "Hazel/Core/Logging/Log.h"
#include "Private/ApplicationSetup.h"
#include "Private/ApplicationMainLoop.h"
namespace Hazel
{
Application::Application(const ApplicationInfo &info) |
cpp | <gh_stars>0
// The AcCoRD 2 Simulator (Actor - based Communication via Reaction - Diffusion)
// Copyright 2021 <NAME>. All rights reserved.
// For license details, read LICENSE.txt in the root AcCoRD2 directory
#include "pch.h"
#include "collision_shape_3d.h"
namespace accord::shape::collision
{
void to_json(Json& j, const Shape3D& shape)
{
shape.ToJson(j);
}
} |
cpp |
private:
static class GLFWwindow* WindowHandle;
static std::vector<int> WatchedKeys;
static std::unordered_map<int, float> WatchedKeysElapsedTime;
static std::unordered_map<int, bool> WatchedKeysDown; |
cpp | unordered_map<string, int> slopeMap;
int n = points.size();
int result = 0;
for (int i = 0; i < n; i++) {
int temp = 0;
int duplicates = 0;
slopeMap.clear();
for (int j = i + 1; j < n; j++) {
int dx = points[j][0] - points[i][0]; |
cpp | }
DigestStream::~DigestStream()
{
delete rdbuf();
}
size_t DigestStream::size() |
cpp | // Fields
// QJniObject forward
template<typename ...Ts> explicit FactoryConfigurationError(const char *className, const char *sig, Ts...agv) : java::lang::Error(className, sig, std::forward<Ts>(agv)...) {}
FactoryConfigurationError(QJniObject obj);
// Constructors
FactoryConfigurationError();
FactoryConfigurationError(java::lang::Exception arg0);
FactoryConfigurationError(JString arg0);
FactoryConfigurationError(java::lang::Exception arg0, JString arg1);
// Methods
JThrowable getCause() const; |
cpp | #include <cstdint>
typedef enum
{
_HSA_QUEUE_TYPE_MULTI = 0,
_HSA_QUEUE_TYPE_SINGLE = 1
} _hsa_queue_type_t;
|
cpp | #define _HAS_EXCRPTIONS 0
#endif
#include <string>
#include <iostream>
#include <fstream>
#include "VP.hpp"
int main() |
cpp | "# StreamVersion 1\n"
"EnterEvent 292 46 0 0 0 0 0\n"
"MouseMoveEvent 273 65 0 0 0 0 0\n"
"MouseMoveEvent 252 88 0 0 0 0 0\n"
"MouseMoveEvent 148 299 0 0 0 0 0\n"
"LeaveEvent 147 301 0 0 0 0 0\n"
"EnterEvent 145 299 0 0 0 0 0\n"
"MouseMoveEvent 145 299 0 0 0 0 0\n"
"MouseMoveEvent 115 190 0 0 0 0 0\n"
"LeftButtonPressEvent 115 190 0 0 0 0 0\n"
"StartInteractionEvent 115 190 0 0 0 0 0\n"
"LeftButtonReleaseEvent 115 190 0 0 0 0 0\n"
"EndInteractionEvent 115 190 0 0 0 0 0\n" |
cpp | } else {
LOG(WARNING) << "Img with unexpected topic: " << msg_topic;
}
} else {
LOG(WARNING) << "Skipping first frame in rosbag, since IMU data not "
"yet available.";
} |
cpp | sleep_time.tv_nsec = duration_ms * 1000 * 1000; // nanoseconds.
while (nanosleep(&sleep_time, &remaining) == -1 && errno == EINTR)
{
sleep_time = remaining;
}
}
|
cpp |
int main()
{
scanf("%d %d", &N, &M);
for (int i = 0; i < M; i++)
{
int s, t;
scanf("%d %d", &s, &t);
graph1[s].push_back(t);
graph2[t].push_back(s);
}
int count = 0;
for (int i = 1; i <= N; i++) |
cpp | int nrhs, const mxArray *prhs[])
{
/* Declare variables. */
int N1,N2, o1,o2,i1,i2,ci,co,r,vi;
int size1,size2; |
cpp | bool CairoDevice::BeginDraw() { cairo_save (fNativeDevice); return true; }
void CairoDevice::EndDraw() { cairo_restore (fNativeDevice); }
void CairoDevice::InvalidateRect( float left, float top, float right, float bottom )
{
cairo_surface_t* surface = cairo_get_target (fNativeDevice);
cairo_surface_mark_dirty_rectangle (surface, left, top, right-left, bottom-top);
}
// -------------------------------------------------------------------
// - Standard graphic primitives -
// -------------------------------------------------------------------
void CairoDevice::MoveTo( float x, float y ) { cairo_move_to (fNativeDevice, x, y); }
|
cpp |
private:
std::vector< T > dataPlaceholder_;
};
} // namespace lsm
|
cpp | abuilder,
std::move(parent_matrix),
type);
return fLayerTransformMap.set(layer_index, { std::move(transform), ascope.release() });
}
bool AnimationBuilder::AttachLayerContext::hasMotionBlur(const skjson::ObjectValue& jlayer) const {
return fMotionBlurSamples > 1
&& fMotionBlurAngle > 0
&& ParseDefault(jlayer["mb"], false);
}
sk_sp<sksg::RenderNode> AnimationBuilder::attachLayer(const skjson::ObjectValue* jlayer,
AttachLayerContext* layerCtx) const { |
cpp | bool hasMSF;
bool hasAttribute;
};
template <typename A>
RandomMaximumSpanningForest::RandomMaximumSpanningForest(const Graph &G, const std::vector< A > &attribute) : G(G), hasWeightedEdges(false), hasMSF(false), hasAttribute(false) {
if (!G.hasEdgeIds()) {
throw std::runtime_error("Error: Edges of G must be indexed for using edge attributes");
}
weightedEdges.reserve(G.numberOfEdges());
G.forEdges([&](node u, node v, edgeid eid) {
weightedEdges.emplace_back(u, v, attribute[eid], eid); |
cpp | * SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/datasync/model/LocationListEntry.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{ |
cpp | auto const kdtree_minmax_point_x = std::minmax_element(begin, end, xless);
auto const kdtree_minmax_point_y = std::minmax_element(begin, end, yless);
auto const kdtree_minmax_point_z = std::minmax_element(begin, end, zless);
auto const minvpx = *vector_minmax_point_x.first;
auto const maxvpx = *vector_minmax_point_x.second;
auto const minvpy = *vector_minmax_point_y.first;
auto const maxvpy = *vector_minmax_point_y.second;
auto const minvpz = *vector_minmax_point_z.first;
auto const maxvpz = *vector_minmax_point_z.second; |
cpp | #include "libc/ctype.h"
namespace lg {
bool isnum(char c) {
return c >= '0' && c <= '9';
}
bool isspace(char c) {
return c == ' ';
} |
cpp |
return scope.Close(Number::New(ret));
}
Handle<Value> sdl::GetNumTouchFingers(const Arguments& args) {
HandleScope scope;
if(args.Length() < 1) {
return ThrowException(Exception::TypeError(
String::New("Invalid arguments: Expected GetNumTouchFingers(Number)")));
}
SDL_TouchID id = static_cast<SDL_TouchID>(args[0]->IntegerValue());
int ret = SDL_GetNumTouchFingers(id);
if(0 == ret) { |
cpp | * Make sure all the kits register their classes with vtkInstantiator.
* Since ParaView uses Tcl wrapping, all of VTK is already compiled in
* anyway. The instantiators will add no more code for the linker to
* collect.
*/ |
cpp | paint.setColor(0xff4285F4);
SkRect rect = SkRect::MakeXYWH(10, 10, 100, 160);
canvas->drawRect(rect, paint);
SkRRect oval;
oval.setOval(rect);
oval.offset(40, 80);
paint.setColor(0xffDB4437);
canvas->drawRRect(oval, paint);
paint.setColor(0xff0F9D58);
canvas->drawCircle(180, 50, 25, paint); |
cpp | }
return Value(true);
}
return Value(false);
}
Value dev_print_stack(void* ctx, int argc, Value* args) { |
cpp | throw ErrorQcStatusUnknown(status);
}
return std::string{str->data(), str->size()};
}
QcStatus parseQcStatus(const frozen::string& statusStr) {
const auto status = mapFind(qcStringsStatus, statusStr);
if (!status) {
throw ErrorAnalysisResultsQcStatusInvalid(statusStr.data());
} |
cpp | // Widevine options
// Path to Widevine CDM binaries.
const char kWidevineCdmPath[] = "widevine-cdm-path";
// Widevine CDM version.
const char kWidevineCdmVersion[] = "widevine-cdm-version";
// Forces the maximum disk space to be used by the disk cache, in bytes.
const char kDiskCacheSize[] = "disk-cache-size";
// Ignore the limit of 6 connections per host.
const char kIgnoreConnectionsLimit[] = "ignore-connections-limit";
} // namespace switches |
cpp | const char kPeopleSearchUrl[] =
"https://www.googleapis.com/plus/v2whitelisted/people/autocomplete";
// OAuth2 scope for access to the Google+ People Search API.
const char kPeopleSearchOAuth2Scope[] =
"https://www.googleapis.com/auth/plus.peopleapi.readwrite";
|
cpp | auto wallHeight = (txs - SCREEN_HEIGHT) / 2;
*textureY = wallHeight * (256 / txs) * 256;
*screenY = HORIZON_HEIGHT;
}
}
} else {
*screenY = 0;
}
} |
cpp | // Updated : 2010-09-16
// Licence : This source is under MIT licence
// File : test/gtc/matrix_transform.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
int main()
{
int Error = 0;
glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240));
|
cpp | MG_RESOURCE_SERVICE_TRY()
m_description = packageDescription;
m_xmlUtil.reset(new MgXmlUtil("ResourcePackageManifest"));
m_rootNode = m_xmlUtil->GetRootNode();
ACE_ASSERT(NULL != m_rootNode);
m_xmlUtil->SetAttribute(m_rootNode, "xmlns:xsi", |
cpp | .mapToThreads(8, 7, 4)
.mapToBlocks(128, 16, 64)
.unroll(16)
.tileImperfectlyNested(false)
.useSharedMemory(true)
.usePrivateMemory(true)
.unrollCopyShared(true)
.matchLibraryCalls(true);
runGroupConvolution(N, G, C, F, H, W, KH, KW, options, true);
}
TEST_F(
GroupConvolution,
GroupConvolution_P100_autotuned_N_32_G_32_C_4_F_4_W_56_H_56_KW_3_KH_3) { |
cpp | s(bg1);
s(bg2);
s(bg3);
s(bg4);
s(bg5); |
cpp |
spaceObject::~spaceObject()
{
}
void spaceObject::draw(lort::Shader *shader, float deltatime)
{
}
void spaceObject::load_buffers()
{
|
cpp | {
}
Count StationarySpacePoint::nr_points() const |
cpp | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/android/content_startup_flags.h"
#include "base/base_switches.h"
#include "base/command_line.h" |
cpp |
/*********************************************************
* CreEPS
*********************************************************/
class CreEPS
{
public: |
cpp | // Constructor
Esp32MAClientSend(String assetName, Esp32MAClientLog &logClient); // Easy constructor. Takes log object as parameter
Esp32MAClientSend(String assetName, QueueHandle_t* ptrxBufferCom, unsigned long* ptrTs);
// Conexion methods
void setMABrokerUrl(String rawBroker);
void setMAClientId(String rawClientId);
void setMAPassword(String rawPassword);
void setConnexionString(String rawConnexionStr);
void setConnexionString(String rawBroker, String rawClientId, String rawPassword);
|
cpp | MeshProcessingConnections<EEK>::GetConnectedComponentFaceIndex_SM(ptr, meshPtr, indices, count);
}
int MeshProcessingConnections_EEK_SplitConnectedComponents_SM(void* ptr, void* meshPtr)
{
return MeshProcessingConnections<EEK>::SplitConnectedComponents_SM(ptr, meshPtr);
}
void MeshProcessingConnections_EEK_GetSplitConnectedComponents_SM(void* ptr, void** meshPtrs, int count)
{
MeshProcessingConnections<EEK>::GetSplitConnectedComponents_SM(ptr, meshPtrs, count); |
cpp | EpCube::EpCube() {
//vbo
glGenBuffers(1, vboID);
|
cpp | int main()
{
int count=0;
double n;
for (int i = 0; i < 6; ++i)
{
scanf("%lf",&n);
if(n>0)count++;
}
printf("%d valores positivos\n",count);
return 0;
}
|
cpp | copy_string(fromBegin, aSrcEnd, writer);
}
void
AppendUnicodeTo( const nsAString::const_iterator& aSrcStart,
const nsAString::const_iterator& aSrcEnd,
nsAString& aDest )
{
nsAString::iterator writer;
uint32_t oldLength = aDest.Length();
if(!SetLengthForWriting(aDest, oldLength + Distance(aSrcStart, aSrcEnd)))
return;
|
cpp | snprintf(aOutput, aOutputMaxLen, "repeated packet transmission is stopped\r\nstatus 0x%02x\r\n", error);
}
else
{
long value;
VerifyOrExit(aArgCount == 2, error = OT_ERROR_INVALID_ARGS);
SuccessOrExit(error = ParseLong(aArgVector[0], value)); |
cpp |
void MovieValidator::validate(Movie& movie)
{
if (movie.getName().length() == 0)
throw(ValidatorException{ "Missing name!" });
if (movie.getGenre().length() == 0)
throw(ValidatorException{ "Missing genre!" });
if (movie.getTrailer().length() == 0)
throw(ValidatorException{ "Missing trailer!" });
if (movie.getYear() == 0)
throw(ValidatorException{ "Year of the movie is 0. First movie ever made was in 1888!" });
if (movie.getLikes() == 0)
throw(ValidatorException{ "0 likes?!" });
|
cpp |
for (size_t i = 0; i < 5; i++)
{
world.Step(1.0f, 6, 2);
pos = box->GetPosition();
angle = box->GetAngle();
printf("%4.3f %4.3f %4.3f\n", pos.x, pos.y, angle);
}
|
cpp | // This file is part of the SST software package. For license
// information, see the LICENSE file in the top level directory of the
// distribution.
#include <sst_config.h> |
cpp | chain_id_type get_egenesis_chain_id()
{
return chain_id_type();
}
void compute_egenesis_json( std::string& result )
{
result = "";
}
|
cpp |
int64 open(const char* path, uint64 mode) {
return syscall_invoke(syscall_open, (uint64)path, mode);
}
int64 close(int64 fd) {
return syscall_invoke(syscall_close, fd);
}
/*int64 reopenfd(int64 fd, const char* path, uint64 mode) {
return syscall_invoke(syscall_reopenfd, fd, (uint64)path, mode);
}*/
int64 copyfd(int64 destFD, int64 srcFD) {
return syscall_invoke(syscall_copyfd, destFD, srcFD);
|
cpp | mos[i] = nullptr;
fedPointer = fedData.insert(fedData.end(), std::make_pair(fedId, mos));
}
fedPointer->second[id] = mo;
fedPointerValue = fedId;
} else
/** DDU MO */
if (typeid(histo) == DDUHistoDefT) {
HwId dduId = histo.getDDUId();
if (dduPointerValue != dduId) { |
cpp | #include <random>
#include <iostream>
int main(int argc, char *argv[])
{
std::random_device rnd; // 非決定的な乱数生成器
for(int i = 0; i < atoi(argv[1]); i++) {
std::cout << rnd() % 9999 << "\n";
}
return 0;
}
|
cpp | class Cxx;
class ostream;
#line 39 "tests/cxx/cxx.fog"
inline ostream& operator<< (ostream& s, const Cxx& aCxx);
#line 47
inline Cxx& g1(unsigned int _i);
inline Cxx& g2(unsigned int _i);
#line 39
inline ostream& operator<< (ostream& s, const Cxx& aCxx)
{
#line 39
s << "Cxx";
}; |
cpp |
class LaneDepartureCheckerNode : public rclcpp::Node
{
public:
explicit LaneDepartureCheckerNode(const rclcpp::NodeOptions & options);
private:
// Subscriber
tier4_autoware_utils::SelfPoseListener self_pose_listener_{this};
rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr sub_odom_;
rclcpp::Subscription<HADMapBin>::SharedPtr sub_lanelet_map_bin_;
rclcpp::Subscription<HADMapRoute>::SharedPtr sub_route_;
rclcpp::Subscription<Trajectory>::SharedPtr sub_reference_trajectory_;
rclcpp::Subscription<Trajectory>::SharedPtr sub_predicted_trajectory_; |
cpp | #include <exception>
#include <string>
class ZiaException : public std::exception
{
public:
explicit ZiaException(const std::string &exception);
~ZiaException() override = default;
const char* what() const throw();
private:
std::string exception; |
cpp | *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ |
cpp | #include <lstm/read_only.hpp>
int main() { return 0; } |
cpp | struct AST_node
{
using ptr = std::unique_ptr<AST_node>;
virtual ~AST_node() {}
virtual void visit(AST_visitor*) = 0;
virtual bool is_empty() const = 0;
std::vector<std::unique_ptr<AST_node>> children; |
cpp | SignalDestroyed(this);
delete this;
}
int64_t Connection::last_received() const {
return std::max(last_data_received_,
std::max(last_ping_received_, last_ping_response_received_));
}
ConnectionInfo Connection::stats() { |
cpp | TEST_F(VideoEncoderTest, Exists)
{
VideoEncoder video;
EXPECT_FALSE(video.IsEncoding());
EXPECT_STREQ(video.Format().c_str(), VIDEO_ENCODER_FORMAT_DEFAULT);
|
cpp | }
main()
{
char ch;
int i,j,k,S,sum,t;
scanf("%d",&t);
getchar();
while(t--)
{
n=0,sum=0,k=0;
while(ch=getchar())
{
if(ch>='0' &&ch<='9') |
cpp | dw2->resize(QSize(400, 400));
auto dw3 = new KDDockWidgets::DockWidgetQuick("Dock #3");
dw3->setWidget(QStringLiteral("qrc:/Guest3.qml"));
auto mainWindow = static_cast<KDDockWidgets::MainWindowMDI*>(KDDockWidgets::DockRegistry::self()->mainwindows().constFirst()); |
cpp | );
BOOL
MainSYST(
LPUSER_DATA pUserData,
LPSTR pszArg
);
BOOL
MainSTAT(
LPUSER_DATA pUserData,
LPSTR pszArg
);
BOOL
|
cpp |
found = false;
for(int firstIndex = 0; firstIndex < firstWord.length(); ++firstIndex)
{
|
cpp | { L_, 0, 0, 1, -1 }, // likewise
{ L_, 0, 0, 1, 0 }, // likewise
{ L_, 0, 0, 1, 100 }, // likewise
{ L_, 1, 0, 0, 2 }, // misaligned destination buffer
{ L_, 1, 0, 0, 4 }, // likewise
{ L_, 1, 0, 0, 8 }, // likewise
{ L_, 1, 0, 0, 16 }, // likewise
{ L_, 1, 0, 0, 32 }, // likewise
{ L_, 0, 0, BIG+1, 1 }, // length > blob.totalSize() - position
{ L_, 0, BIG, 1, 1 } // length > blob.totalSize() - position |
cpp | this->ui->lbl_version->setText( versionText );
this->setWindowTitle( "About Redon " );
} |
cpp | public:
float getCapturesPerSecond() {
if (-1 == captures) {
return 0;
}
|
cpp | }
void GLState::bind_input_layout(const PipelineSpec* spec, ogl::VBO* slot, uint8_t slot_size)
{
int16_t prev_vbo_slot = -1;
for (const PipelineSpec::VertexAttribute& attr : spec->attributes) { |
cpp | bool AMDTOpenCLHelper::isExtensionSupported(
char* extensionName,
const char* extensionsString)
{
bool retVal = false;
// Search for extensionName in the extensions string.
// (The use of strstr() is not sufficient because extension names can be prefixes of
// other extension names).
char* pCurrentPos = (char*)extensionsString;
char* pEndPos;
int extensionNameLen = strlen(extensionName); |
cpp | }
}
// If memory currently pointing at is non-zero then goto goto next same depths preceding '['
else if (reader.getChar() == ']')
{
if ((int)*ptr != 0)
{
loopDepth = 1;
reader.previousChar(); |
Subsets and Splits