text
string
size
int64
token_count
int64
#include "TimeTrial.hpp" #include "../global/globals.hpp" #include <SDL2/SDL.h> #include <cmath> #include <iomanip> #include <iostream> #include <sstream> namespace state { const int ORB_SIZE = global::ORB_SIZE; const int DRAG_THRESHOLD = 0.3 * ORB_SIZE; const double swapAnimationTime = 400; //milliseconds const dou...
17,553
6,550
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtXmlPatterns module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid...
4,191
1,229
#include "../../template.hpp" int LargestSubsetWithGcd1(vi arr) { // size <= 32 int n = arr.size(); int ans = 0; for (int i = 0; i < (1 << n); ++i) { int g = 0; int count = 0; for (int j = 0; j < n; ++j) { if (i & (1 << j)) { ++count; g = ...
935
399
#include "UModEditor.h" #include "SUModPalette.h" void SUModPalette::Construct(const FArguments& Args) { /*ChildSlot [ //Creating the button that adds a new item on the list when pressed SNew(SScrollBox) + SScrollBox::Slot() [ //The actual list view creation + SScrollBox::Slot() [ SAssignNew(List...
1,072
415
/* * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * 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 * * Unless required by applicable...
11,175
3,535
// // Copyright (c) 2019-2022 Ruben Perez Hidalgo (rubenperez038 at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "boost/mysql/connection.hpp" #include <boost/asio/ip/tcp.hpp> #inclu...
2,847
929
#ifdef TEST #include <catch2/catch_test_macros.hpp> #include <catch2/catch_approx.hpp> #include "activation_mock.hpp" #include "layer_mock.hpp" #include "test_value.hpp" #include "value_factory_mock.hpp" #include <array> #include <forward_list> #include <future> #include <numeric> using namespace Catch; namespace c...
3,497
1,122
/* tests/pybind11_tests.cpp -- pybind example plugin Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #include "depthai_pybind11_tests.hpp" #include <functional> #include <...
1,832
557
/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include <Artifact/Factory/TestImpactTestEnumerationSuiteFactory.h> #include <Artifact/TestImpactA...
3,377
940
/* ### * IP: GHIDRA * * 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 * * Unless required by applicable law or agreed to ...
26,472
10,183
#include "utility.h" ///////////////// // fail_fast() // ///////////////// #include <Windows.h> #include <iostream> void fail_fast() { if(IsDebuggerPresent()) DebugBreak(); std::cerr << "fail_fast() called." << std::endl; std::exit(EXIT_FAILURE); }
263
95
/* * Largest prime factor * * Problem 3 * * Created by quisseh on 11/2/15. */ #include "problem0003.h" /* * A number will have at most one prime factor * greater than its square root. So loop through * potential prime factors of [target], and * if one is found, reduce [target] by the current * [factor]. If...
1,120
350
void arrays();
14
4
// testBSPDE1.cpp // // Testing 1 factor BS model. // // (C) Datasim Education BV 2005 // #include "fdmdirector.cpp" #include "arraymechanisms.cpp" #include <iostream> #include <string> using namespace std; #include "exceldriver.cpp" void printOneExcel(Vector<double, long> & x, Vector<double, long>& func...
2,625
1,138
// // LineDrawer.hpp // SmoothDrawing // // Created by Benny Khoo on 18/10/2015. // // #ifndef LineDrawer_hpp #define LineDrawer_hpp #include <stdio.h> #include "GestureRecognizers.hpp" using namespace cocos2d; class LineDrawer : public Node { public: static constexpr float DefaultLineWidth = 1.0f; ...
16,006
4,876
#include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #define FIFO_NAME "/var/tmp/fifo_test" int main() { int ret = 0; int pipefd = 0; // 判断fifo文件是否已存在 if (access(FIFO_NAME, F_OK) == -1) { // 不存在则创建 ret = mkfifo(FIFO_...
978
413
//quiz.cpp #include <iostream> using namespace std; int main() { char c = 'x'; char *pC = &c; cout << ++(*pC) << endl; }
140
62
#include "toSystem.h" namespace chaoskit::flame { core::TransformSystem toTransformSystem(const System& system) { return {toTransform(system), toParams(system)}; } core::CameraSystem toCameraSystem(const System& system) { core::CameraSystem result{toTransformSystem(system)}; auto cameraTransform = toCameraTra...
494
151
#include "exercises.h" #include <algorithm> #include <vector> #include <numeric> double minimumAverageCompletionTime(std::vector<unsigned int> tasks, std::vector<unsigned int> &orderedTasks) { sort(tasks.begin(), tasks.end()); /* What they want you to do do { permutations.push_back(tasks); }...
1,544
535
/* ==================================== JUCER_BINARY_RESOURCE ==================================== This is an auto-generated file: Any edits you make may be overwritten! */ namespace BinaryData { //================== PDOicon.ico ================== static const unsigned char temp_binary_data_0[] = { 0,...
67,258
65,712
#include "collidermath.h" #include "cylindercollider.h" #include "spherecollider.h" #include "boxcollider.h" #include "compoundcollider.h" #include "engine/components/transformcomponent.h" #include "engine/components/physicscomponent.h" #include "engine/components/collisioncomponent.h" #include "engine/basics/gameobj...
15,433
5,236
#include <iostream> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <cstdlib> #include <string.h> #include <cstring> using namespace std; int generate_Mask(int vertices,std::string mask_file){ FILE *fp_mask; fp_mask=fopen(mask_file.c_str(),"w"); for(int i=0;i<vertices;i++){ int a=...
6,674
2,425
// ======================================================================================== // ApproxMVBB // Copyright (C) 2014 by Gabriel Nützi <nuetzig (at) imes (d0t) mavt (d0t) ethz // (døt) ch> // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL w...
1,751
599
/* * DAXPI program. * Run the program as follows. * Compilation: * g++ daxpy.cc -fopenmp * Run: * ./a.out */ #include <stdio.h> #include <omp.h> #include <iostream> #define SIZE 1 << 16 namespace { std::pair<double, int> get_parallel_execution_time(int X[], int Y[], int a, int num_of_threads) { omp_set_num_t...
2,456
1,039
// // Created by david on 2019-07-09. // #include "ceres_direct_functor.h" #include <algorithms/class_algorithm_status.h> #include <ceres/gradient_problem.h> #include <config/nmspc_settings.h> #include <tensors/class_tensors_finite.h> #include <tensors/model/class_model_finite.h> #include <tensors/state/class_state_fi...
9,141
2,882
//Andreas Koudounis 40089191 #include "Triangle.h" Triangle::Triangle(Point* pt1, Point* pt2, Point* pt3) { p1 = pt1; p2 = pt2; p3 = pt3; } Triangle::~Triangle() { std::cout << "Triangle object deleted"; } void Triangle::print() const { }
271
129
#include <vector> #include "CDevice.hh" #include "OPTICKS_LOG.hh" void test_SaveLoad(const char* dirpath) { std::vector<CDevice> devs, devs2 ; bool nosave = true ; CDevice::Visible(devs, dirpath, nosave ); CDevice::Dump( devs, "visible devices"); CDevice::Save(devs, dirpath ); CDevice::L...
833
332
// 01.Introduction.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <string> #include <array> using namespace std; void GetLowerUpper(string a) { int lower = 0; int upper = 0; int total = a.length(); for (int i = 0; i < total; i++) { if (int(a[i]) >...
1,632
673
/****************************************************************************** Copyright (c) 2021, Farbod Farshidian. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code m...
13,760
4,547
/***************************************************************************** * Xidi * DirectInput interface for XInput controllers. ***************************************************************************** * Authored by Samuel Grossman * Copyright (c) 2016-2021 ********************************************...
8,942
2,579
//////////////////////////////////////////////////////////////////////////// // Module : autosave_manager.cpp // Created : 04.11.2004 // Modified : 04.11.2004 // Author : Dmitriy Iassenev // Description : Autosave manager //////////////////////////////////////////////////////////////////////////// #include "stda...
1,434
571
#include <fstream> #include <memory> #include <string> #include "./constants.h" #include "gtest/gtest.h" #include "jwt/hmacvalidator.h" #include "jwt/jwt.h" #include "jwt/messagevalidatorfactory.h" #include "jwt/nonevalidator.h" #include "jwt/rsavalidator.h" // Test for the various validators. TEST(parse_test, proper_...
12,540
5,548
#include "toyviewer.h" #include <tinker_platform.h> #include <files.h> #include <glgui/rootpanel.h> #include <glgui/menu.h> #include <glgui/filedialog.h> #include <glgui/checkbox.h> #include <models/models.h> #include <tinker/application.h> #include <renderer/game_renderingcontext.h> #include <renderer/game_renderer....
6,065
2,718
#include "SiteData.h" #include <ios> #include <iostream> using namespace std; static int callback(void * used, int argc, char ** argv, char ** szColName) { // set pointer structs values select_wrapper * encSelect = (select_wrapper *) used; encSelect->password = string(argv[0]); // get rid of warning if (0 ...
2,428
859
// // Created by jim on 24.01.18. // #include "Graphics.h" #include <glm/gtx/matrix_transform_2d.hpp> #include <orbital/math/elementary.h> #include <orbital/common/convert.h> Graphics::Graphics( size_t const rows, size_t cols ) { if (0 == rows) { throw std::runtime_error{"graphics cann...
6,300
2,121
#pragma once /// /// MIT License /// Copyright (c) 2018-2019 Jongmin Yun /// /// 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 /// AUT...
2,017
717
#include "draganddroplabel.h" #include <QDropEvent> #include <QMimeData> DragAndDropLabel::DragAndDropLabel(QWidget *parent) : QLabel(parent) { setAcceptDrops(true); } void DragAndDropLabel::dragEnterEvent(QDragEnterEvent *event) { Q_ASSERT(event); if (event->mimeData()->hasUrls()) { event->...
622
222
/* Decoda Copyright (C) 2007-2013 Unknown Worlds Entertainment, Inc. This file is part of Decoda. Decoda is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any...
115,226
39,702
// // Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton // MySQL backend copyright (C) 2006 Pawel Aleksander Fedorynski // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #define SOCI_MYSQL_SOURCE ...
1,065
374
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mx = 5e6+1; ll ans[mx]; void D(int n){ ll sum = 0; for(int i=1;i*i<=n;i++){ if(n%i==0){ sum+=i; if(n/i!=i) sum+=(n/i); } } ans[n] =sum; } int main(){ int t, n; scanf("%d", &t); while(t--){ scanf("%d", &n); if(a...
384
230
#include "BuildTriggerBuilder.h" #include "CommonRegexes.h" #include "ParserHelpers.h" #include <iomanip> mappers::BuildTriggerBuilder::BuildTriggerBuilder() { registerKeys(); clearRegisteredKeywords(); } mappers::BuildTriggerBuilder::BuildTriggerBuilder(std::istream& theStream) { registerKeys(); parseStream(theS...
1,843
665
//======================================================================= // Copyright (c) 2013 Piotr Wygocki // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //=================================================...
3,001
1,002
// Copyright 2015 Patrick Putnam // // 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 // // Unless required by applicable law o...
1,920
639
#pragma once #include <Tanker/Crypto/Hash.hpp> #include <Tanker/Crypto/PrivateSignatureKey.hpp> #include <Tanker/Crypto/Signature.hpp> #include <Tanker/Serialization/SerializedSource.hpp> #include <Tanker/Trustchain/Actions/Nature.hpp> #include <Tanker/Trustchain/Actions/UserGroupAddition/v1.hpp> #include <Tanker/Trus...
1,964
711
#include "NVM_Transaction_Flash.h" #include "assert.h" namespace SSD_Components { NVM_Transaction_Flash::NVM_Transaction_Flash( Transaction_Source_Type source, Transaction_Type type, stream_id_type stream_id, unsigned int data_size_in_byte, LPA_type lpa, PPA_type ppa, User_Request* user_requ...
2,739
1,277
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int tc,m,n,temp; scanf("%d",&tc); for(int i=0;i<tc;i++) { vector<int> v; cin>>m>>n; for(int x=0;x<n;x++) { cin>>temp; v....
571
228
#include "sphere.hpp" void Sphere::init(btDiscreteDynamicsWorld *world, Model *model, const btVector3 position) { Mesh::init(world, model, position, btQuaternion(0.0f, 0.0f, 0.0f, 1.0f), btScalar(5.0f)); albedo = glm::vec4( (float) rand() / (float) RAND_MAX, (float) rand() / (float) RAND_MAX, (float) r...
499
220
#include <emp-tool/emp-tool.h> #include "2pc.h" using namespace std; using namespace emp; const string circuit_file_location = macro_xstr(EMP_CIRCUIT_PATH); static char out3[] = "92b404e556588ced6c1acd4ebf053f6809f73a93";//bafbc2c87c33322603f38e06c3e0f79c1f1b1475"; int main(int argc, char** argv) { int port, party; ...
1,464
718
#include<iostream> #include<algorithm> #include<cstdio> #define N 1000000 using namespace std; int f[N][2],size[N]; int n,tot; int g[N],d[N],a[N][4],fa[N],b[N]; struct node{ int x,l,r; }c[N]; int sum; void ins(int x,int y){ a[++sum][0]=y,a[sum][1]=g[x],g[x]=sum; } void dfs(int x){ size[x]=1; for (int i=g[x];i;i=a[...
2,441
1,660
#include "MainMenu.h" #include "Utils/ToggleKey.h" #include "Application.h" #include "MenuWorldSelect.h" MainMenu::MainMenu(Application& applic) : StateBase(applic), background(glm::vec2(0.5f, 0.5f), glm::vec2(1, 1), "GUI/background.jpg", (*app->getWindow())) { buttons.emplace_back(glm::vec2(0.5f, 0.4f), glm::vec2...
1,424
577
#include "oglpch.h" #include "Renderer.h" #include "RendererAPI.h" #include "Framebuffer.h" namespace OpenGLRendering { struct MeshInfo { Ref<VertexArray> VertexArray; Ref<Material> Material; glm::mat4 ModelMatrix; }; struct RendererData { Ref<Camera> Camera; Ref<Cubemap> Cubemap; Ref<Shader> PBR...
10,225
4,106
#include <iostream> #include <vector> using namespace std; vector<int> correctBitScores(vector<int>); vector<int> bitScore(vector<int>); int findPairs(vector<int>); int main() { int a, b; int pairs = 0; vector<int> vec; vector<int> bitscore; cout << "\nEnter count of nos: "; cin >> a; for ...
2,106
803
/* * Copyright 2015 Applied Research Center for Computer Networks * * 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 * * Unless required b...
6,211
2,156
/*---------------------------------------------------------------------------*\ Copyright (C) 2014 Applied CCM Copyright (C) 2011-2017 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of CAELUS. CAELUS is free software: you can redist...
30,008
8,457
#include <iostream> int main() { int x = 25; int *ptr = nullptr; ptr = &x; std::cout << "Here is the value in x, printed twice:\n" << x << std::endl << *ptr << std::endl; *ptr = 100; std::cout << "Once again, here is the value in x:...
427
148
//////////////////////////////////////////////////////////// // SiSaveAsCmd.h: Saves the image according to the SiSaveCmdValue // CmdValue passed in. // //!!!! NOTE: THIS IS A HACK CURRENTLY! The command derives from //!!!! SiRunStretchScriptCmd, adding the SiSaveCmdValue parameters to //!!!! the file, then running ...
4,147
1,300
#ifndef LABEL_BUTTON_HPP #define LABEL_BUTTON_HPP #include <string> #include <QPushButton> #include <QMouseEvent> #include <QColor> #include "../label.hpp" class CogButton : public QPushButton { Q_OBJECT public: CogButton() = delete; CogButton(Label label, QWidget *parent = 0); // QColor color(...
557
212
#include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <algorithm> #include <vector> #include <string> #include <limits> #include "itkAddImageFilter.h" #include "itkDefaultConvertPixelTraits.h" #include "itkMultiplyImageFilter.h" #include "itkImage.h" #include "itkVectorImage.h" #include "itkImageBase.h" ...
13,696
4,421
#pragma once #include "OctreeArray.hpp" #include "OctreeCell.hpp" #include "OctreeBranch.hpp" /** * outer node implementation of an octree cell.stores pointers to items. */ namespace hxa { class OctreeLeaf : public OctreeCell { private: OctreeArray<const void*> items_m; public: OctreeLeaf(); OctreeLeaf(const ...
1,096
387
// Simple helpers that aren't specific to Maya. #include "Helpers.h" #include <stdarg.h> #include <stdio.h> #include <wchar.h> #include <fstream> #include <exception> #include <vector> using namespace std; string Helpers::vssprintf(const char *fmt, va_list va) { va_list va2 = va; int size = vsnprintf(nullpt...
10,017
3,568
#pragma once #include <memory> #include <unordered_map> #include "Llvm.hpp" #include "Expressions.hpp" #include "Statements.hpp" #include "Scope.hpp" #include "Function.hpp" namespace yat { extern llvm::LLVMContext GlobalContext; extern std::unique_ptr<llvm::Module> GlobalModule; extern std::unordered_...
412
136
#include <pybind11/pybind11.h> #include <pybind11/eigen.h> #include <ipc/distance/distance_type.hpp> #include <ipc/distance/edge_edge.hpp> #include "../utils.hpp" namespace py = pybind11; using namespace ipc; void define_edge_edge_distance_functions(py::module_& m) { m.def( "edge_edge_distance", ...
3,766
1,207
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2010 Couchbase, Inc * * 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 * * h...
8,250
3,093
#include "syncps.hpp" #include <iostream> /** @brief Timestamp naming convention (rev3). */ namespace Timestamp { using TlvType = std::integral_constant<int, 0x38>; inline uint64_t now() { ::timespec tp; ::clock_gettime(CLOCK_REALTIME, &tp); return static_cast<uint64_t>(tp.tv_sec) * 1000000 + static_cast<uint6...
3,105
1,161
Emitter::Emitter() : Registerable(), Transformable(), zone( &getDefaultZone() ), full(true), tank(-1), flow(0.0f), forceMin(0.0f), forceMax(0.0f), fraction( random(0.0f,1.0f) ), active(true) {} Zone& Emitter::getDefaultZone() { static PointZone defaultZone; return defaultZone; } void Emitter::registerChil...
1,843
777
/* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is also distributed with certain ...
15,008
5,117
/** * @file: compute.hpp * @author: Liu Hongbin * @brief: * @date: 2019-11-28 10:39:09 * @last Modified by: lenovo * @last Modified time: 2019-11-28 16:13:43 */ #ifndef GEOMETRY_HPP #define GEOMETRY_HPP #include <cmath> #include "utilities.hpp" namespace HSF { // face area scalar calculateQUADArea(const Array<s...
1,414
520
#include <google/protobuf/compiler/js/well_known_types_embed.h> struct FileToc well_known_types_js[] = { {NULL, NULL} // Terminate the list. };
147
55
#include <iostream> #include <fstream> #include <algorithm> #include <cassert> #include <set> #include <queue> #include <vector> #include "State2.h" class StateComparator { public: /* Determina algoritmul folosit. */ enum Algorithm { AStar, }; StateComparator(Algorithm algorithm) : algorithm_(algo...
3,455
1,237
/* mapping3D_swc_plugin.cpp * This is a test plugin, you can use it as a demo. * 2015-6-25 : by Zhi Zhou */ #include "v3d_message.h" #include <vector> #include "mapping3D_swc_plugin.h" #include "openSWCDialog.h" #include "../neurontracing_mip/my_surf_objs.h" #include "../neurontracing_mip/smooth_curve.h" #include ...
21,265
7,951
/* Boost examples/io.cpp * show some exampleso of i/o operators * thanks to all the people who commented on this point, particularly on * the Boost mailing-list * * Copyright 2003 Guillaume Melquiond * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or * co...
4,998
1,824
#include "../../io/InputStream.hpp" #include "../../../JString.hpp" #include "../Provider.hpp" #include "./CRL.hpp" #include "./CertPath.hpp" #include "./Certificate.hpp" #include "./CertificateFactorySpi.hpp" #include "./CertificateFactory.hpp" namespace java::security::cert { // Fields // QJniObject forward Cer...
3,530
1,299
/****************************************************************************** * Copyright 2019 The Apollo Authors. All Rights Reserved. * * 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 ...
4,999
1,939
/* * Copyright 2018 Yeolar * * 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 * * Unless required by applicable law or agreed to in wr...
951
332
#include "AusExGroveI2cTouchSensor.h" /* * */ AUSEX_GROVE_I2C_TOUCH_SENSOR_CLASS::AUSEX_GROVE_I2C_TOUCH_SENSOR_CLASS(TwoWire *theWire, int32_t sensorID ){ _i2c_if=theWire; _sensorID=sensorID; } bool AUSEX_GROVE_I2C_TOUCH_SENSOR_CLASS::begin(uint32_t addr){ _i2c_addr=addr; _i2c_if->begin(); mpr121Setup();...
4,690
2,449
#ifndef XE_INTERFACE_SYSTEM_HPP #define XE_INTERFACE_SYSTEM_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// //#include <XESystem/gkDebugger.h> #include <XESystem/SystemConfig.hpp> //#include <ThirdParty/plog/Log.h> // //INITIALIZE...
533
156
/* * Copyright 2019 Alex Andres * * 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 * * Unless required by applicable law or agreed to ...
1,294
417
#ifndef NEL_MEMORY_HH #define NEL_MEMORY_HH #include <cstdint> // uint8_t #include <cstddef> // size_t #include <utility> // std::move, std::swap namespace nel { void memcpy(uint8_t *const d, uint8_t const *const s, size_t const n) noexcept; void memset(uint8_t *const d, uint8_t const s, size_t const n) noexcept; v...
1,106
489
#ifndef PROJECTFILEGENERATOR_HPP #define PROJECTFILEGENERATOR_HPP #include "ProjectData.hpp" #include "FSFuncs.hpp" #include "ConfigMgr.hpp" int GenerateProjectFiles( ProjectData & data ); #endif // PROJECTFILEGENERATOR_HPP
227
87
#pragma once #ifndef RAZ_MATHUTILS_HPP #define RAZ_MATHUTILS_HPP #include <algorithm> #include <cassert> #include <type_traits> namespace Raz::MathUtils { /// Computes the linear interpolation between two values, according to a coefficient. /// \tparam T Type to compute the interpolation with. /// \param min Minimu...
3,378
1,048
/// <summary> /// Contains the definition for the class axis::domain::elements::DoF. /// </summary> /// <author>Renato T. Yamassaki</author> #pragma once #include "foundation/Axis.CommonLibrary.hpp" #include "foundation/memory/pointer.hpp" #include "nocopy.hpp" namespace axis { namespace domain { namespace boundary_...
3,286
1,036
#include "PChart.h" #include "moses/FactorCollection.h" namespace Moses { namespace Syntax { namespace S2T { PChart::PChart(std::size_t width, bool maintainCompressedChart) { m_cells.resize(width); for (std::size_t i = 0; i < width; ++i) { m_cells[i].resize(width); } if (maintainCompressedChart) { m_...
677
247
class Solution { public: string convert(string s, int nRows) { if (nRows <= 1 || s.size() <= 1) return s; string result; for (int i = 0; i < nRows; i++) { for (int j = 0, index = i; index < s.size();j++, index = (2 * nRows - 2) * j + i) { result.append(1, s[index]); if (i == 0 || i == nRows...
473
238
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/actions/sdk/v2/interactionmodel/prompt/static_prompt.proto #include "google/actions/sdk/v2/interactionmodel/prompt/static_prompt.pb.h" #include <algorithm> #include <google/protobuf/stubs/common.h> #include <google/protobuf/io/coded_stream...
95,558
33,569
/////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Microsoft Corporation. // // SYNOPSIS // // Defines the class Request. // /////////////////////////////////////////////////////////////////////////////// #include <polcypch.h> #include <iasattr.h> #includ...
8,355
2,964
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; typedef vector<ll> vll; int main() { vector<int> nums(3); for (int i = 0; i < 3; ++i) { cin >> nums[i]; } sort(nums.begin(), nums.end()); cout << nums[0] * nums[1] / 2 << endl; return 0; }
316
143
#include<bits/stdc++.h> using namespace std; const int MAX = 65535; int arr[MAX] = {0}; char ch; int main(){ for(int i = 1;cin >> ch && ch != 'E'; i++){ if(ch == 'W'){ arr[i] = 1; } if(ch == 'L'){ arr[i] = 2; } } int w = 0, l = 0; for(int i = 1; 1;...
1,188
463
#ifndef WALI_LONGESTSATURATING_PATH_SEMIRING_HPP #define WALI_LONGESTSATURATING_PATH_SEMIRING_HPP #include "wali/SemElem.hpp" #include "wali/MergeFn.hpp" #include "wali/ref_ptr.hpp" #include "wali/Key.hpp" #include <set> namespace wali { /// This is a funny domain. But maybe it'll be useful? I just use it for ...
1,662
546
#include <iostream> void foo(int val1, int val2) { std::cout << "From non-template" << std::endl; std::cout << val1 << " " << val2 << std::endl; } template<typename T> void foo(T val1, T val2) { std::cout << "From non-variadic" << std::endl; std::cout << val1 << " " << val2 << std::endl; } template<typ...
560
228
/* * Copyright (C) 2018 The Android Open Source Project * * 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 * * Unless required by app...
12,254
4,426
#include "Game/VsGameSection.h" #include "types.h" /* Generated from dpostproc .section .ctors, "wa" # 0x80472F00 - 0x804732C0 .4byte __sinit_vsGameSection_cpp .section .rodata # 0x804732E0 - 0x8049E220 .global lbl_8047FF98 lbl_8047FF98: .4byte 0x00000000 .4byte 0x00000000 ...
127,143
80,152
// you can replace this string before building the client in order to // match the shared secret that the server is expecting. // Please don't abuse your power to do this. // Remember that this is an indie game made entirely by one guy and being // run on a shoestring budget server. Making a truly "secure" game, whe...
687
172
#include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <vector> #include <Xlsx/Workbook.h> #ifdef _WIN32 #include <windows.h> #endif #ifdef QT_CORE_LIB #include <QDateTime> #endif using namespace SimpleXlsx; int main() { setlocale( LC_ALL, "" ); time_t CurTime = time( NULL ); ...
4,633
1,726
#include <iostream> #include <vector> int main() { int cd_case_num, listen_cd_num; std::cin >> cd_case_num >> listen_cd_num; std::vector<int> cds(cd_case_num); for (int i = 0; i < cd_case_num; ++i) { cds.at(i) = i + 1; } int current = 0; for (int i = 0; i < listen_cd_num; ++i) { int listen_cd; ...
572
265
// This file is part of the "x0" project, http://xzero.io/ // (c) 2009-2018 Christian Parpart <christian@parpart.family> // // Licensed under the MIT License (the "License"); you may not use this // file except in compliance with the License. You may obtain a copy of // the License at: http://opensource.org/licenses/...
2,594
941
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include "vm/datastream.h" namespace dart { StreamingWriteStream::StreamingWriteStream(intptr_t initi...
1,931
670
// // Expr.cpp // pgf+ // // Created by Emil Djupfeldt on 2012-06-26. // Copyright (c) 2012 Chalmers University of Technology. All rights reserved. // #include <gf/reader/Expr.h> namespace gf { namespace reader { Expr::Expr() { } Expr::~Expr() { } ...
324
125
#include "AinurState.h" #include <boost/config/warning_disable.hpp> #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/phoenix_core.hpp> #include <boost/spirit/include/phoenix_operator.hpp> #include "AinurDoubleOrFloat.h" namespace PsimagLite { struct MyProxyFor { static void convert(long unsigne...
6,995
2,538
#include "wordlist_wordle_solver.h" #include "wordle_helpers.h" #include "wordle_rules.h" #include "wordle_selectors.h" #include "wordle_solver.h" #include <algorithm> #include <fstream> #include <functional> #include <iostream> #include <random> #include <set> #include <string> #include <unordered_map> #include <vect...
5,924
2,051
/* Problem : https://www.hackerrank.com/challenges/sherlock-and-array C++ 14 Approach : This is quite a straight forward problem. All elements of the input array is set to the sum of all the elements upto that point of the input array, i.e. arr[i] = Sum(arr[j]) for 0 <= j <=i < n ...
1,539
525