blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
5724f06c92dee07753828ba2f1693bebb6bfef08 | 2e6b5c56a31a9b20b27c05397843bfc4a43e0b90 | mushfiq-906/cp__training | /CMP302-Fall2020/CMP302-Fall2020-Lab6/Cut Rod.cpp | C++ | cpp | 1,474 | permissive | // Author : Abdallah Hemdan
// For Hassanosama, ICPC next year ISA.
#include <bits/stdc++.h>
#define endl '\n'
#define sz size()
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define all(v) ((v).begin()), ((v).end())
#define rall(v) ((v).rbegin()), ((v).rend())
#define... |
eab9619a392d6cf59a33937539ea33c53aaee339 | 40d9dbdd4f31a23ea16b1b7dda827eedafc3a0a7 | zxycode007/Sapphire | /SapphireBase/SapphireCMeshManipulator.cpp | C++ | cpp | 48,351 | no_license | #include "SapphireCMeshManipulator.h"
#include "SapphireSMesh.h"
#include "SapphireCMeshBuffer.h"
#include "SapphireSAnimatedMesh.h"
#include "SapphireOS.h"
namespace Sapphire
{
static inline Vector3 getAngleWeight(const Vector3& v1,
const Vector3& v2,
const Vector3& v3)
{
// Calculate this triangle's weight ... |
6d74c8007778336a023dae6faeabaf70219d8298 | 9005f6bfaab69a54b60b01542d09d0d5f6bd3075 | seanshpark/coreclr | /tests/src/Interop/IJW/NativeVarargs/IjwNativeVarargs.cpp | C++ | cpp | 14,319 | permissive | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#include <cstddef>
#include <vector>
#include <cstdarg>
#include <cstdint>
#include <numeric>
#include <array>
#inclu... |
97eb4804c8998059c878c09c207e1c7142d056bf | e699720c4ce2b7e72ee18ef8dc1abe4660660bef | Atlasio777/Lab_PSTU | /Основы алгоритмизации и программирования/Второй семестр/lb10_v5/lb10_v5/Time.cpp | C++ | cpp | 2,956 | no_license | #include "Time.h"
#include <string>
// преобразование времени в секунды
unsigned int Time::toSecond(unsigned int m, unsigned int sec)
{
return m * 60 + sec;
}
// преобразование секунд в минуты и секунды
void Time::toTime(unsigned int& seconds, unsigned int& min, unsigned int& sec)
{
min = seconds / 60;
s... |
29842102b66a4778f92cef2dd9fa23d33c9d3546 | 7ab4bf7a93f9d74f42badb399ee3941bba5453f1 | vgcoinbtc/vgcoin | /src/qt/paymentserver.cpp | C++ | cpp | 24,982 | permissive | // Copyright (c) 2011-2014 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "paymentserver.h"
#include "bitcoinunits.h"
#include "guiutil.h"
#include "optionsmodel.h"
#include "base58.h"
#include... |
fcb4ccb20798cbe0d1fb0a5199b37e02233ac6cb | 267dace116355aa5884db9994a35d183e2a3ef76 | RockyYan1994/Algorithm | /aimoffer/包含min函数的栈.cpp | C++ | cpp | 1,142 | no_license | /*
定义栈的数据结构,请在该类型中实现一个能够得到栈最小元素的min函数。
感觉这个min函数的意思是返回当前的栈内的最小值,看discussion中大多数的实现都是采用两个栈实现,一个辅助栈来维持最小值。直接搬运的结果,没有实现。
*/
链接:https://www.nowcoder.com/questionTerminal/4c776177d2c04c2494f2555c9fcc1e49
来源:牛客网
class Solution {
public:
stack<int> stack1,stack2;
void push(int value) {
stack1.pu... |
10c9b1a4becddda1ea921f6e81130c80d335a156 | 4d66907b212ce3deb71808d1370adb6268451888 | zhengshizhao/OpenSpace | /modules/base/rendering/planetgeometry.cpp | C++ | cpp | 3,452 | permissive | /*****************************************************************************************
* *
* OpenSpace *
* ... |
82e5951a2568344478c7f5b624240e83c80ceeb1 | 2553789d7c18d28034345fcf3a282eaf75d73381 | arangodb/arangodb | /3rdParty/V8/v7.9.317/src/codegen/string-constants.cc | C++ | cc | 5,598 | permissive | // Copyright 2018 the V8 project 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 "src/codegen/string-constants.h"
#include "src/base/functional.h"
#include "src/numbers/dtoa.h"
#include "src/objects/objects.h"
#include "src... |
902c880a17927b6e4e24564e0bedf0bccbb7ad79 | c13a581581579aa558fcdb0eac57bd84adc0b7d1 | OsvaldoSalomon/CProgramsITSA | /ArrayParesImpares.cpp | C++ | cpp | 1,026 | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int>arrayPares;
vector<int>arrayImpares;
int arrayNum[50] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,
26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50};... |
9478b06ecd77a5f34ec740f16b46a8bdf84ee78a | 248df58a7fe273f2e141d13f7fe6fa74033dc6e1 | lelou13/tuscany-sca-cpp | /sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp | C++ | cpp | 6,094 | permissive | /*
*
* Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
*
* 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/LICENS... |
f94a1e182e436c3df010de6f908c936a5af87924 | 08ea05ea794cf3fdc23f50c6f061f52b229568ee | abadillo999/Klondike | /src/Utils/BooleanDialog.cpp | C++ | cpp | 313 | no_license | /*
* BooleanDialog.cpp
*
* Created on: Dec 27, 2017
* Author: alejandro
*/
#include "BooleanDialog.h"
namespace Utils {
BooleanDialog::BooleanDialog() {
// TODO Auto-generated constructor stub
}
BooleanDialog::~BooleanDialog() {
// TODO Auto-generated destructor stub
}
} /* namespace Utils */
|
2ed93707abdac1e81fe29c8888016e11739fd9ed | 6290f0e45c48ce3af751e5f511a822635fbc4be4 | ilangal-amd/amd-gpuperfstudio-dx12 | /GPUPerfStudio/Server/Common/Windows/OSWrappers.cpp | C++ | cpp | 5,884 | permissive | //==============================================================================
// Copyright (c) 2013-2015 Advanced Micro Devices, Inc. All rights reserved.
/// \author AMD Developer Tools Team
/// \file
/// \brief Windows-Specific wrapper functions. Use a generic platform-agnostic function
/// to perform OS-... |
3c68b99701a7781e63fec1002c4eb25dcc059a94 | afd436d430ae02f4e763ab4e3701d7d2d97e6df2 | solodolo/FrizzXX | /tests/runner_tests.cpp | C++ | cpp | 3,056 | no_license | /*
* runner_tests.cpp
*
* Created on: Aug 22, 2020
* Author: dmmettlach
*/
#include <gtest/gtest.h>
#include "runner.h"
#include "test_helpers.h"
class RunnerTests : public ::testing::Test {
protected:
RunnerTests()
: util(config) {}
std::filesystem::path parent_dir;
Frizz::Runner runner;
Friz... |
3f1a7f00ea962a21fdcb951b8e551196f4149b3b | 1dfca6ba1a0010007400c677a449924db4b5f355 | Steve132/ndarray | /nd_ext/cimg/display.cpp | C++ | cpp | 3,441 | permissive | #include "display.hpp"
#ifdef __ANDROID__
#define cimg_display 0
#endif
#include <CImg.h>
using namespace cimg_library;
namespace nd {
namespace cimg {
//template<class T> const CImg<T>& display(const char *const title=0, const bool display_info=true, unsigned int *const XYZ=0,
//const bool exit_on_anykey=false) c... |
2ed279e749b3d11461fab25cc61d51eaeb1a9e38 | 0dd4523864ba210cf52f67c016c99ec56fa10656 | antoniocarrillo69/Alarma | /Libreria/FORMAS/2D/CDim2D.cpp | C++ | cpp | 764 | no_license | //---------------------------------------------------------------------------
#include <vcl.h>
#include "d:\libreria\Formas\2D\CDim2D.h"
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
// Constructor de la clas... |
b78fa33eff2719af995398c05d7c7c7d22f9a345 | 2fb4f16c42ee66616bc8fb98fcd694d1cfc31bf4 | sebas5384/EmulationStation | /es-core/src/components/TextEditComponent.cpp | C++ | cpp | 7,595 | permissive | #include "components/TextEditComponent.h"
#include "resources/Font.h"
#include "Renderer.h"
#define TEXT_PADDING_HORIZ 10
#define TEXT_PADDING_VERT 2
#define CURSOR_REPEAT_START_DELAY 500
#define CURSOR_REPEAT_SPEED 28 // lower is faster
TextEditComponent::TextEditComponent(Window* window) : GuiComponent(window),
... |
8df940057a8c9c1c023972a2a5665276849a058d | 8598694f26f4552a83f157425c9f541ee1b30f05 | Penguinsuckers/MiningOperations | /src/inih/INIReader.cpp | C++ | cpp | 2,544 | permissive | // Read an INI file into easy-to-access name/value pairs.
// inih and INIReader are released under the New BSD license (see LICENSE.txt).
// Go to the project home page for more info:
//
// https://github.com/benhoyt/inih
#include <algorithm>
#include <cctype>
#include "../../include/ini.h"
#include <cstdlib>
#includ... |
a1e70975f0c48cdc0684ed0c10043d37c2b75feb | 277a4cfbb3e27eb78a49b9d44a58871b91225659 | AleCoria94/clasesayed | /guiadelos83/ejercicio03.cpp | C++ | cpp | 443 | no_license | #include <iostream>
using namespace std;
/*Ejercicio Nro. 3:
Dados dos valores N y M determinar e imprimir cuales y cuantos múltiplos de M hay dentro del
conjunto 1 a N.
*/
int main() {
int N, M, i,smul=0;
cout<< "Ingrese el valor N"<< endl;
cin >> N;
cout<< "Ingrese el valor M"<< endl;
cin >> M;
for (i>... |
7511931ca5bb27545b28cffef8510b89ff780d45 | c683a28744807cb6e0f67355aaaa16c88dbdc29b | psiha/sweater | /include/boost/sweater/detail/apple.hpp | C++ | hpp | 9,162 | permissive | ////////////////////////////////////////////////////////////////////////////////
///
/// \file apple.hpp
/// ---------------
///
/// (c) Copyright Domagoj Saric 2016 - 2018.
///
/// Use, modification and distribution are subject to the
/// Boost Software License, Version 1.0. (See accompanying file
/// LICENSE_1_0.t... |
d25ee3d4dade6a347bd37ae50742bd5e1eac4e31 | c198d2252d3144f910fe4426338068a11baabd2b | XtendCash/onion-xtendcash-blockchain-explorer | /src/CurrentBlockchainStatus.cpp | C++ | cpp | 14,652 | permissive | //
// Created by mwo on 16/05/17.
//
#include "CurrentBlockchainStatus.h"
#include <chrono>
#include <thread>
#include <iostream>
#include <memory>
#include <mutex>
#include <atomic>
namespace lokeg
{
static const uint64_t DAY_0_CIRC_SUPPLY = 15606500;
using namespace std;
void
CurrentBlockchainStatus::set_blockcha... |
cd0af84b11627d28fabbf9ceb44e54d451d0a3c4 | a64cf4f9817111ca994d689581a3f8964452e986 | meniossin/src | /third_party/webrtc/p2p/base/relay_server_unittest.cc | C++ | cc | 16,594 | permissive | /*
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing ... |
87a6f3373e8377f1c0843ecd7a99cfc5d8a0c6a3 | 83f3372de7f345def3b02eb85d520581986544fb | kusku/red-forest | /EngineUAB/Code/Graphics/Particles/ParticleEmitterSystem.cpp | C++ | cpp | 1,568 | no_license |
#include <assert.h>
#include "ParticleEmitterSystem.h"
#include "ParticleEmitterSystemInstance.h"
#include "ParticleEmitter.h"
#if defined(_DEBUG)
#include "Memory\MemLeaks.h"
#endif
CParticleEmitterSystem::CParticleEmitterSystem(const std::string& name)
: m_Name(name)
{
}
CParticleEmitterSystem::~C... |
cb17101dbb5167cacaa5e82605c53c9d4733532c | dcc9bb007423b7fb73ed3a5c4ed95873e2adcfbc | boy2000-007man/LeetCode | /54-Spiral-Matrix/solution.cpp | C++ | cpp | 900 | no_license | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> result;
if (!matrix.empty()) {
int dx[] = {0, 1, 0, -1},
dy[] = {1, 0, -1, 0},
il = 0,
ir = matrix.size() - 1,
jl = 0,
... |
5e9c6652546f18a92d4974165c6807f11139ad98 | d2f4b8f6c4a9c4132457629bd9e4da1dd8a95eb6 | mitunya/CLCXX | /src/c_interface.cpp | C++ | cpp | 1,941 | permissive | // #include "clcxx/array.hpp"
#include <cstdint>
#include "clcxx/clcxx.hpp"
#include "clcxx/clcxx_config.hpp"
extern "C" {
CLCXX_API bool clcxx_init(void (*error_handler)(char *),
void (*reg_data_callback)(clcxx::MetaData *,
uint8_t)) {
... |
cce16f8ce9efd37212552057b41f90ce26f3efd7 | bf9d44b05cebbf9c7bddc52c15810633c9af7763 | haeyoung97/PracticeAlgorithm | /HamiltonianCircuitsProblem/HamiltonianCircuitsProblem/20170294_박해영.cpp | C++ | cpp | 1,529 | no_license | #include <iostream>
#include <vector>
using namespace std;
void hamiltonian(int i);
bool promising(int i);
vector<vector<bool>> W;
vector<int> vindex;
int n, cnt;
int main() {
printf("Input number of vertices :");
scanf("%d", &n);
W = vector<vector<bool>>(n + 1, vector<bool>(n + 1, false));
vindex = vector<int>... |
9db06f631399c10b6d6f4ed986e43cce414132db | 7260a2bc1f39c2fa1908c1cd88e8d4919ba80578 | jiangxincode/CppTest | /src/others/main0548.cpp | C++ | cpp | 705 | permissive | /**
如何判断一个单链表是有环的?(注意不能用标志位,最多只能用两个额外指针)
*/
#include <cstdlib>
struct node
{
char val;
node* next;
};
/**
搞两个指针,一个每次递增一步,一个每次递增两步,如果有环的话两者必然重合
*/
bool check(struct node* head)
{
if(head==NULL)
{
return false;
}
struct node *slow=head;
struct node *fast=head;
while((fast!=NU... |
47d2c46527e563617ea01f719e274b1aac1e8538 | 8484e3368d139f63365e8e03e74fad43d397c367 | pspoerri/wrapper_prototype | /usercode/dycore_example/dycore_init.cpp | C++ | cpp | 293 | no_license | #include <iostream>
#include "dycore_init.h"
wrappable *init_dycore() { return new dycore(); }
void destroy_dycore(wrappable *m) { delete m; }
bool check_fortran_fields_uptodate(wrappable *m) {
dycore *dycore_ptr = (dycore *)m;
return dycore_ptr->check_fortran_fields_uptodate();
}
|
01939ddea940545e6d0d7e0344f330bcc8abffc9 | 0ec94b5c893bbb721da68b8e39ef194698a6efa0 | limberc/mindspore | /mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.cc | C++ | cc | 18,001 | permissive | /**
* Copyright 2019 Huawei Technologies 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 law... |
2336c2b88622fd144fc69dea5e74429215b5ca36 | e7e13b6005462b5e273eb2df6475c72869caa36f | GhostWalker562/godot-admob-iOS-precompiled | /export/core/crypto/hashing_context.cpp | C++ | cpp | 4,900 | permissive | /*************************************************************************/
/* hashing_context.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... |
dc90861112008314e68ba93b30623d6faa9e505d | 227ef725bcc04e9436a55d064fb099b68f9ecc19 | 15831944/job_mobile | /lib/lib_mech/src/server/TServer/TWorld/PlugIn_Server.cpp | C++ | cpp | 3,016 | no_license | /* file : PlugIn_Server.cpp
Coder : by icandoit ( mech12@nate.com)
Date : 2009-07-08 14:05:42
comp.: wiki.aqrius.com
title :
desc :
*/
#include "stdafx.h"
#include "TWorld.h"
jPLUGIN_CPP_CODE_START_Server(PlugIn_Server)
{
}
jPLUGIN_CPP_CODE_STOP(PlugIn_Server)
{
}
jPLUGIN_CPP_CODE_END_Server(PlugIn_Server);
Plug... |
4363d22000ea50c597d51bcd5d219f3c95bf13ad | e100e3ada5e05ff047114c7af5dff2e1338a51c3 | XHXaiXXR/code | /面试基础/复习二叉树面试题/求二叉树的叶子结点/test.cpp | C++ | cpp | 379 | no_license | int LeafNodeSize()
{
if (_root == NULL)
{
return 0;
}
size_t size = 0;
_LeafNodeSize(_root, size);
return size;
}
protected:
void _LeafNodeSize(Node* root, size_t& size)
{
if (root == NULL)
{
return;
}
_LeafNodeSize(root->_left, size);
_LeafNodeSize(root->_right, size);
if (root->_... |
719d457e1b5657048d40858bcb31c55c413fce48 | 8f740328469d132ab2671e7b478a73daea28b312 | Laucksy/CS-205-Lab-Repo | /referencetest/main.cpp | C++ | cpp | 7,187 | no_license | #include <iostream>
#include "gtest/gtest.h"
#include "../reference/game.h"
#include "../reference/gamehistory.h"
#include "../reference/player.h"
#include "../reference/playergamehistory.h"
using namespace std;
class GameTest : public ::testing::Test {
protected:
GameTest() {}
virtual ~GameTest() ... |
d0596aff348407da9c349d2158d3c47124e09c08 | 7436e9ab1bc61d60fde86324968859747111e1e7 | syuki/GM_Motion | /GM31_Motion/CSceneX.cpp | C++ | cpp | 2,003 | permissive | #include "CSceneX.h"
std::vector<CSceneX*> CSceneX::sceneXList;
CSceneX* CSceneX::Create(LPDIRECT3DDEVICE9 D3Device, char* Model){
// Variable daclaration
CSceneX* newData;
// Instantion and initialize
newData = new CSceneX(D3Device,Model);
return newData;
}
CSceneX::CSceneX(LPDIRECT3DDEVICE9 D3Device, char*... |
8ff2942b066c2583efcd1e0e339d347fceefbe8e | 6e4bf442f29aca0943f9ad3695bb60c0d71496a5 | SatyakiDas/ulab_course_materials | /FALL 2020/CSE 201/src/constructor_destructor/main_func.cpp | C++ | cpp | 290 | no_license | #include "CustomDate.cpp"
using namespace std;
int main()
{
CustomDate date1, date2(10), date3(27, 11), date4(28, 10, 2019);
CustomDate date5(date1);
date1.print();
date2.print();
date3.print();
date4.print();
date5.print();
return 0;
}
|
7d54ee2309d7f8c220dc69e452fc288f175f877b | ae646ae24f50d718555995a18ce0efd2a9bb767e | WEGFan/Algorithm-Contest-Code | /contests/2017-CCPC-Xiangtan-Invitational/I.cpp | C++ | cpp | 294 | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
long long n, m;
while (~scanf("%lld %lld", &n, &m))
{
long long a = __gcd(n, m), b = 2 * m * n;
long long g = __gcd(a, b);
printf("%lld/%lld\n", a / g, b / g);
}
return 0;
} |
2f4099f40557939b15804a1aaf03ce7a96871cd5 | 01747abac6a1909295bc4d120d1b7c59190ac950 | RussellJerome/DeepRockGalacticSDK | /SDK/FSD_BP_SupplyPod_Beacon_functions.cpp | C++ | cpp | 3,574 | no_license | // DeepRockGalactic SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "FSD_BP_SupplyPod_Beacon_parameters.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Functions
//---------------------------------------------------------------------------
// Functio... |
04be71461cf4dbd74132f3ed0d04967eb12223f9 | 2208f3871c8d52937ad8a70cff0ef4e447e63c9c | Tianji95/leetcode-solutions-cpp-and-python | /by_sequence/9/9.cpp | C++ | cpp | 438 | no_license | class Solution {
public:
bool isPalindrome(int x) {
if(x < 0)
return false;
if(x == 0)
return true;
int back = 0;
int tmpX = x;
int revertX = 0;
while(tmpX){
back = tmpX % 10;
revertX = revertX * 10 + back;
t... |
d6a5433055c6ba6effd623e2c55edcbbcb709b0e | bd9b3bfe20104038ab9df3247062730d5f6bec7a | jainamjb/solutions_cpp | /Parenthesis_chk_coursera/main.cpp | C++ | cpp | 1,929 | no_license | #include <iostream>
#include<string.h>
using namespace std;
char s[100000][2];
long top=-1,i=0;
void push(char a,int i);
char peek();
int main()
{
string a;
cin>>a;
bool m=true;
// int u=0,v=0,w=0,p;
long l,p;
l=a.length();
for(i=0;i<l;i++){
if(a[i]=='(')
{push(... |
1b6a3b77e64cb58662448f5f1d4804c6a06c6f20 | d46212b25051ea2ab160ff82b825e95426bacdbc | guateng8/Multi-client-communication | /Server/server/server.cpp | C++ | cpp | 9,625 | no_license | #include "server.h"
#include "sclient.h"
/**
* 全局变量
*/
char dataBuf[MAX_NUM_BUF]; //写缓冲区
BOOL bConning; //与客户端的连接状态
BOOL bSend; //发送标记位
BOOL clientConn; //连接客户端标记
SOCKET sServer; //服务器监听套接字
CRITICAL_SECTION cs; //保护数据的临界区对象
HAN... |
5673336c97cfbb5d880c507dbacfe8b1dcd5a077 | 50648a3cdaf5ea2d7f126503f159a844cfbd5011 | nestorjhernandezm/pokerface-plus-plus | /src/deck.cpp | C++ | cpp | 573 | no_license | #include "deck.hpp"
#include <algorithm>
#include <ctime>
#include <cstdlib>
Deck::Deck()
{
for(Suit suit : all_suits)
{
for(Rank rank : all_ranks)
{
Card c(rank, suit);
m_cards.push_back(c);
}
}
}
void Deck::shuffle()
{
std::srand(unsigned(std::time(0)... |
ffd694364e61335893e0011e960280e8d82d1300 | 16dd1c398c5150f5584ba87ebe1b642a9af93955 | YuxuanHe/Leetcode | /Power of Two.cpp | C++ | cpp | 334 | no_license | class Solution {
public:
bool isPowerOfTwo(int n) {
if(n<=0)
return false;
int count = 0;
for(int i = 0; i< 32; i++) {
if(n & 1)
count++;
n = n>>1;
}
if(count == 1)
return true;
else
return fa... |
0337bd0879b68ebf738dad0d5c8c60fcb5307e0d | 3adf48651ad5d56eb827577b2a39ca14ad14cead | pranav1698/Competitive-Programming | /Datastructures/Heap/reorganize_string.cpp | C++ | cpp | 1,377 | no_license | // Reorganiza a string using max Heap
// SlothyCoder16
// August 04, 2020
class compare {
public:
bool operator()(const pair<char, int> p1, const pair<char, int> p2) {
return p1.second < p2.second;
}
};
class Solution {
public:
string reorganizeString(string S) {
unordered_map<char, int> u... |
c142638c3c54f0b7ba91ec7113f62a27fffe3e81 | 708d852157290931f4c3faf88a8501dcb007c7f5 | spimentel1201/Sistema-Reserva-de-Boletos-Cine | /databaseexception.cpp | C++ | cpp | 262 | no_license | #include "databaseexception.h"
#include <QMessageBox>
DatabaseException::DatabaseException(QString e)
{
exceptionV="NONE";
exceptionV=e;
}
void DatabaseException::view()
{
QMessageBox::critical(nullptr, "Alerta", exceptionV,QMessageBox::Ok);
}
|
5772c5854de95736447325bb573bb0d65550f66a | 80230661038eef5d2441f7454ac2ca20b5f18b16 | StrangeIlia/jasmine | /collections/enumerator/Enumerator.hpp | C++ | hpp | 721 | no_license | #ifndef ABSTRACTITERATOR_H
#define ABSTRACTITERATOR_H
#include <QSharedPointer>
namespace bstu {
template<class T> class AbstractEnumerator {
public:
AbstractEnumerator() {}
virtual ~AbstractEnumerator() {}
virtual T current() const = 0;
virtual bool moveNext() = 0;
};
template<class T> class Enumera... |
5a8bf5ae9bf0dc19c177c23452a7cef3f6b22794 | 6e4df3b640688179593222fb81695fc49049e022 | sdslabs/Rubeus | /RubeusCore/Source/InputManager/input_manager.cpp | C++ | cpp | 12,865 | permissive | /**
* @file Source/input_manager.cpp.
*
* @brief Defines the Input Manager class along with helper functions
*/
#include <input_manager.h>
#include <window_component.h>
namespace Rubeus
{
void mouseButtonCallback(GLFWwindow *window, int button, int action, int mods)
{
RInputManager::MouseButtonMap[button] =... |
dc97b57120d8598b7edffc7d0618fb0689ff2eae | 9fc5925e3d015af9a8331dba07d4bb077efe32a8 | ImC4k/COMP2011 | /games/solve_sudoku.cpp | C++ | cpp | 8,133 | no_license | #include <iostream>
using namespace std;
// CONSTANTS
const int BOARD_SIZE = 9;
const int SIZE = 3;
const int board[BOARD_SIZE][BOARD_SIZE] = {{5,3,0,0,7,0,0,0,0},
{6,0,0,1,9,5,0,0,0},
{0,9,8,0,0,0,0,6,0},
... |
b1b146ef75d63ab8679e7448fdf719c810ad2778 | 2c186cf1b12099bc4b8d8b8082e881d1ca3b7447 | Elzair/vulkan-tutorial | /lessons/11-shader/main.cpp | C++ | cpp | 16,073 | no_license | #include <stdlib.h>
#include <cstring>
#include <iostream>
#include <vector>
#include <stdexcept>
#include <functional>
#include "common.hpp"
#include "queue.hpp"
#include "swapchain.hpp"
#include "shader.hpp"
class HelloTriangleApplication
{
public:
void run()
{
initWindow();
initVulkan();
mainLoop();... |
3cd9193f07d5a64f00054b69bc0912bf2b8aeab4 | 0b15f616a51c7d1c2b313e88be4ca330242799b6 | pinkbeamline/PinkJFIOC | /jfrxApp/src/O.linux-x86_64/jfrx_registerRecordDeviceDriver.cpp | C++ | cpp | 13,406 | no_license | /* THIS IS A GENERATED FILE. DO NOT EDIT! */
/* Generated from ../O.Common/jfrx.dbd */
#include <string.h>
#include "compilerDependencies.h"
#include "epicsStdlib.h"
#include "iocsh.h"
#include "iocshRegisterCommon.h"
#include "registryCommon.h"
extern "C" {
epicsShareExtern rset *pvar_rset_aSubRSET, *pvar_rset_aai... |
4aa4c7206ba7ea2669154ad1c5916df1a19772b8 | f41ea5d33d1ea564775a8eff1d9d9db0de579a54 | andrwwbstr/webkit | /Source/WebKit2/WebProcess/WebProcess.cpp | C++ | cpp | 50,526 | no_license | /*
* Copyright (C) 2009, 2010, 2012, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this li... |
a043dee8db2efcc5f89ad8078f7c982da5cfec35 | c74bf4f34c7ce9b9fccc4ad02110e4807f39cf83 | timblechmann/nt2 | /modules/core/predicates/bench/simd/is_inf.cpp | C++ | cpp | 1,926 | permissive | //==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// ... |
9943a332a6f5840b5db1495a564254fdbede733e | 5da1efc81114e184cc7cf52b74aba1813aefd53d | yanghaomai/dst | /drtm-dst/src/core/utils/thread.cc | C++ | cc | 2,460 | permissive | /*
* The code is part of our project called DrTM, which leverages HTM and RDMA for speedy distributed
* in-memory transactions.
*
*
* Copyright (C) 2015 Institute of Parallel and Distributed Systems (IPADS), Shanghai Jiao Tong University
* All rights reserved.
*
* Licensed under the Apache License, Versi... |
c5b3121c5cb793aa12388fc38a0cb55c65dc2397 | 32843961cbac3f792ffd36fb5e7083998bc74534 | OpenIFEM/OpenIFEM | /tests/acoustic_duct_wave/acoustic_duct_wave.cpp | C++ | cpp | 4,196 | permissive | /**
* This program tests serial Slightly Compressible solver with an
* acoustic wave in 2D duct case.
* A Gaussian pulse is used as the time dependent BC with max velocity
* equal to 6cm/s.
* This test takes about 770s.
*/
#include "parameters.h"
#include "scnsim.h"
#include "utilities.h"
extern template class F... |
f6f989fe66321da615315b67ebc522aab2cb604c | 4b99dc607a856df16c12da2310b29be85795e0c6 | zjsxzy/Leetcode | /Shortest String That Contains Three Strings/main.cpp | C++ | cpp | 1,474 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
class Solution {
public:
string minimumString(string a, string b, string c) {
string res = f(f(a, b), c);
string t = f(f(a, c), b);
if (t.size() < res.size() || (t.size() == res.size() && t < res)) res = t;
t = f(f(... |
a615274b7e693389dbf3065921f57a834107babf | f030e69128481782bb692dac6e2a546cd47ad033 | alexandraback/datacollection | /solutions_5640146288377856_0/C++/Tombana/A.cpp | C++ | cpp | 1,442 | no_license | #include <iostream>
#include <queue>
#include <cstring>
using namespace std;
int main()
{
int T;
cin >> T;
for (int run = 1; run <= T; ++run)
{
int R, C, W;
cin >> R >> C >> W;
// 0-based indices!
// For a single row:
// how many turns do I need for hitting it ... |
7f97543144d6fb6de60e1d4687e5adc675f76ae7 | 3d1ccb7b6cd8532660060ded2b96cff0667ef2c7 | ipupiara/JoesTriac | /stm32/jt/Middlewares/ST/touchgfx/framework/include/touchgfx/TextureMapTypes.hpp | C++ | hpp | 7,885 | no_license | /******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory... |
7e9e19d3ea20440c7d311e5e7b820cd74e4a282b | d845a750952e8579937c1e31ac1f23cfa18f129e | AmadeusMK/CPPLec | /08/lec54.cpp | C++ | cpp | 1,463 | no_license | #include "lec54.h"
using namespace std; // std:: 생략가능
/*
클래스(타입) : 특정한 용도를 수행하기 위한 변수와 함수를 모아 둔 틀(자료형)
클래스 = 자료저장(변수) + 자료처리(함수) + ...
객체(오브젝트) : 그 틀을 이용하여 찍어낸 개체 ( 변수, 메모리 상의 공간 )
지시자 : private, protected, public
접근 제어 지시자를 명시적으로 지정하지 않을 경우
class 의 경우 private , struct 의 경우 public 이 기본... |
c3f2e573e2208bf6042de57c64e1ce1a8fe88f3f | 409e88cb65c2691500d62801844aa5157b4e1455 | tavisca-bmohan/Assignment1 | /lib/root.cpp | C++ | cpp | 331 | no_license | #include<bits/stdc++.h>
using namespace std;
int max(int a, int b){
return a>b?a:b;
}
int div(int a, int b){
return a/b;
}
int mul(int a, int b){
return a*b;
}
int main(int argc, char* argv[]){
cout<<"Hello WOrld of git";
cout<<endl<<mul(34,26);
cout<<"\nlearning Git";
r... |
fb4e134ff9c512da603184ec43493746ba1a779a | 80dd755a59992ae24ad29fda9ef1d5078975059c | JoeLoser/fbthrift | /thrift/compiler/test/fixtures/frozen-struct/gen-cpp2/include1_types.cpp | C++ | cpp | 2,748 | permissive | /**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#include "src/gen-cpp2/include1_types.h"
#include "src/gen-cpp2/include1_types.tcc"
#include <algorithm>
#include <folly/Indestructible.h>
#include "src/gen-cpp2/include1_data.h"
namespace apache... |
3b975afda2cf91a519f6f472cd26146e245adc92 | b86b7fe78d2b63743a7fbabe2837592712e8bf73 | rvege1409/Algorithm | /BOJ_3197.cpp | C++ | cpp | 2,153 | no_license | #include <iostream>
#include <queue>
#include <cstring>
#include <cstdio>
using namespace std;
char map[1501][1501];
int dist[1501][1501];
int visit[1501][1501];
int visit2[1501][1501];
int dx[4] = { -1,1,0,0 };
int dy[4] = { 0,0,-1,1 };
int R, C;
int lap = 0;
int lx, ly;
queue <pair<int, int > > temp;
queue<pair<int... |
57bcfe53b01e9472d21b5935feb10c5c83cd5e67 | 914b19e838d6ef57106bd218ce8a3370f43d4ada | jmosborne/Chaste | /cell_based/src/population/forces/ChemotacticForce.cpp | C++ | cpp | 4,109 | permissive | /*
Copyright (c) 2005-2021, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
ddf8f69b63b21f81f6442d9e3852e520d86cca8e | 36a22a91864f64d057146ff44fcf126e7d725842 | muhammadmoizulhaq/LazerTag | /Source/LazerTag/SpawnVolume.cpp | C++ | cpp | 1,924 | no_license | #include "SpawnVolume.h"
#include "LazerTag.h"
#include "Kismet/KismetMathLibrary.h"
#include "Components/BoxComponent.h"
#include "Pickup.h"
// Sets default values
ASpawnVolume::ASpawnVolume()
{
// do not nned to tick
PrimaryActorTick.bCanEverTick = false;
// only server should have access to this
if (GetLocalR... |
bf103c078cf769df071a7281fca8122b155bc22b | bbde3f7c831a983ee90b393898d37bb005019086 | TerwalEast/AscensionLib | /AscensionLib/GameManager.hpp | C++ | hpp | 991 | no_license | //
// GameManager.hpp
// AscensionLib
//
// Created by shan on 2021/2/21.
// Copyright © 2021 TeamAscension. All rights reserved.
//
#ifndef GameManager_hpp
#define GameManager_hpp
#include <stdio.h>
#include <vector>
#include "AeroPlaneGame.hpp"
class Player;
class ChessBoard;
class Splash;
class MainMenu;
... |
0fa1c6068a93c96b1bf82aa42609e186c5f22c2a | e063df1c31db1fd2068a5b223ac596f7c1ce099d | jwilges/samples | /library/include/algorithm/equilibrium.hpp | C++ | hpp | 466 | no_license | #ifndef __ALGORITHM_EQUILIBRIUM_HPP__
#define __ALGORITHM_EQUILIBRIUM_HPP__
#include <vector>
namespace algorithm
{
// returns the right-most pivot offset in the values vector such that
// the difference between the sums of the values around the pivot offset,
// i.e. sum of values (pivot, end] less sum o... |
f49c7dd85dc1d17e6e055a0c3e569bc651fd45fa | 7104eb3b010e2fb598db62b1c03fa2b925b49b17 | dolorem/zoldak | /src/ZkGame/Entities/CrosshairEntity.cpp | C++ | cpp | 1,807 | no_license | #include <SFML/Graphics.hpp>
#include <QtGui>
#include <QDebug>
#include <memory>
#include "../../ZkCommon/Constants.hpp"
#include "../../ZkCommon/LibraryCast.hpp"
#include "../Renderables/Renderable.hpp"
#include "../Renderables/CrosshairRenderable.hpp"
#include "Entity.hpp"
#include "CrosshairEntity.hpp"
#includ... |
d74d41674e4f87488ebefa30c041642bb1bdf733 | f76c3cb3deb35dced53df7aab830a63e0f8b616f | isaponsoft/libamtrs | /tests/string-wildcard.cpp | C++ | cpp | 4,547 | permissive | /* Copyright (c) 2019, isaponsoft (Isao Shibuya) All rights reserved. *
* Use of this source code is governed by a BSD-style license that *
* can be found in the LICENSE file. */
#include <amtrs/tests.hpp>
#include <amtrs/string/wildcard.hpp>
#include <amtrs/system/log.hpp>
using... |
1f03951e932682092097301474899ce30183f710 | 2450d8826b02f42679c13f1c181898d644a5bb8b | SeanKBit/OOP_101_Cpp | /OOP_101_Cpp.cpp | C++ | cpp | 7,777 | no_license | // SolarSystemObj.cpp : This file contains the 'main' function. Program execution begins and ends there.
// Demonstrate some key "object-oriented" / Cpp concepts, such as: static variables, vectors, pointers and reference variables, encapsulation/abstraction through classes, function overloading
#include "Planet.h"... |
fac6d71d4182ac8ace5ec0a8f5cdff561066e456 | 8dfb537e92c7835cf60f404e8fe6c1cc68e7d330 | CharlesE-233/aliyun-openapi-cpp-sdk | /cdn/src/model/ModifyHttpHeaderConfigRequest.cc | C++ | cc | 2,513 | permissive | /*
* Copyright 2009-2017 Alibaba Cloud 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required... |
1508dcd8689032463f2c41a94ebb60cb546a5e7c | ab253ddc7606d0447696ebfc5ea1d4ab46a2bded | chandabindu/analyzer | /hana_decode/THaEvData.cxx | C++ | cxx | 10,264 | permissive | ////////////////////////////////////////////////////////////////////
//
// THaEvData
// Hall A Event Data from One "Event"
//
// This is a pure virtual base class. You should not
// instantiate this directly (and actually CAN not), but
// rather use THaCodaDecoder or (less likely) a sim class like
// THaVD... |
053ca27d4343e8a3541b73b739e31758402b6569 | 4cc6baf9daf09d74736261d63a857b91e536be7b | Emasoft/opentoonz | /toonz/sources/common/tgeometry/tcurveutil.cpp | C++ | cpp | 16,889 | permissive |
#include "tcurveutil.h"
#include "tcurves.h"
#include "tmathutil.h"
#include "tbezier.h"
//=============================================================================
/*
Questa funzione ritorna un vettore di
coppie di double (DoublePair) che individua i parametri
dei punti d'intersezione.
L'intero restituito ... |
35f9ad449ca9cff75c8b8f570c109d81ee8d250f | cd5ea7ec310f64c6186f75339807928b395d7a92 | fengwang/larbed-refinement | /include/f/pattern/coefficient_composer.hpp | C++ | hpp | 5,489 | no_license | #ifndef SRLKAITHWSTFQACLNKPTUULCJSEYKYCLRLAHPBDYPAFOJEHHEFRNSUWHYYKSRSDWCTYCPXEFG
#define SRLKAITHWSTFQACLNKPTUULCJSEYKYCLRLAHPBDYPAFOJEHHEFRNSUWHYYKSRSDWCTYCPXEFG
#include <f/matrix/matrix.hpp>
#include <f/polynomial/term.hpp>
#include <f/polynomial/polynomial.hpp>
#include <f/pattern/elementary_pattern.hpp>
#includ... |
2147fe4c5365940b477c2cae2477f3af6ff12d42 | 0f17dd7f377bf29aa36303956d7962b15b1de1e2 | aSeijiNagai/Readium-Chromium | /ash/display/output_configurator_animation.cc | C++ | cc | 7,758 | permissive | // 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 "ash/display/output_configurator_animation.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "base/bind.h"
#include "base... |
2d230279a9e779f2e2f56fce1db29ae993835af3 | 50b2c0e8c4722e844485560140c8498b1b753ab5 | DanDoge/course_pku | /Algorithm Design and Analysis/oj/openjudge3479.cpp | C++ | cpp | 2,613 | no_license | #include <iostream>
#include <vector>
#include <memory.h>
#include <queue>
using namespace std;
const int INF = 1000000000;
const int N = 404;
struct edge{
int src;
int dst;
int cap;
int flow;
edge(int s, int d, int c, int f){
src = s, dst = d, cap = c, flow = f;
}
};
int n = 0, m = 0... |
c63ceadba18eefbf2968867d73157d1a6733989b | 0c09702788a0bfa7dfe5a53bd96e773a134facf0 | SadiHassan/Codeforces | /CodeforcesRound_690/CF690_D.cpp | C++ | cpp | 777 | no_license | //ACCEPTED!!!
#include<bits/stdc++.h>
using namespace std;
int main(){
int T;
cin >> T;
for(int t = 1; t <= T; t++){
int N;
cin >> N;
vector<int> arr(N, 0);
int sum = 0;
for(int i = 0; i < N; i++){
cin >> arr[i];
sum += arr[i];
}
for(int op = 0; op <= N; op++){
... |
14bd4c2aa8941f7ca704d1fea29ac3f6eee9074b | 9625636526959fff6d5c6dd0f86ee68a2de7ee0d | ammarhakim/gkeyll1 | /unit/lcmultiregion.cxx | C++ | cxx | 1,214 | no_license | /**
* @file lcmultiregion.cxx
*
* @brief Unit tests for Lucee::MultiRegion class
*/
// lucee includes
#include <LcMultiRegion.h>
#include <LcTest.h>
void
test_1()
{
// create connections for 3 regions connected together as follows
//
//
// +------------+-------------+
// | | |
// | 0 ... |
1d392c9257807d3f63878697e952c1e4bb38c28b | 4d8b922cdd2c29dba69c7db1783fe533483925f4 | eleyng/particlefiltercpp | /src/particlefiltercpp_arrays.cpp | C++ | cpp | 5,863 | no_license | // Implementation of a PF on CPU in C/C++
// Using PF to estimate the position (state) on a 1D mass-spring-damper system
//#include "stdafx.h"
#include <functional>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <random>
#include <chrono>
#include <fstream>
using namespace std;
... |
c928facdace7519dc21b27d907dd9b261982360a | 4161b55b4a9a2f2e65b9ed758006254fbc21cb13 | asmuth444/Computer-Graphics | /Bresenham.cpp | C++ | cpp | 919 | no_license | #include<iostream>
#include<GL/glut.h>
#include<stdlib.h>
#include<conio.h>
using namespace std;
float xf,xl,yf,yl,dx,dy,x,y,pk;
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0,0.0,1.0);
gluOrtho2D(0,100,0,100);
dx = xl-xf;
dy = yl-yf;
pk = 2*dy-dx;
glBegin(GL_POINTS);
x = xf;
y = yf;
for(int i... |
dc30dcae5ce3c33e23eafcf12cca2ce082ed70ac | a73ed577b16484a26e24427af57b1854fff1d50b | wyk9787/AlgorithmAndDataStructure | /garrdy_library/Algorithm/searching/linear_search.cpp | C++ | cpp | 578 | no_license | // Created by Garrett Wang on 12/30/16
// linear_search.cpp
// Running time: O(n)
#include <iostream>
#include <vector>
using namespace std;
int linear_search(vector<int> &a, int key) {
for (int i = 0; i < a.size(); i++)
if (a[i] == key)
return i;
return -1;
}
int main(int argc, char const *argv[]) {
... |
03731b06c8c374b775614676d7cba1ee43d8bee0 | b8b4a8d5e9bd8bbc40cf017e6b569fc2c11e47ac | pavelkumbrasev/cpp-courses | /14_sfinae/14_02_enable_if_contexts/14_02_01_function_parameters.cpp | C++ | cpp | 432 | permissive | #include <type_traits>
#include <iostream>
// Redefinition problem
template <typename T, typename U = std::enable_if_t<std::is_pointer<T>::value>>
T foo(T, int)
{
std::cout << "pointer" << std::endl;
return T{};
}
template <typename T, typename U = std::enable_if_t<!std::is_pointer<T>::value>>
T foo(T, long)... |
647b70ed8647f73110582496665050df34527118 | c1254db7e915a379851360299e83e853f618cdf2 | Krazymud/Homework | /C++/mediator/Dress.hpp | C++ | hpp | 330 | no_license | #ifndef _DRESS_
#define _DRESS_
#include <iostream>
using std::string;
class Dress {
private:
string name;
int price;
public:
Dress(const string & name, const int price);
Dress(const Dress & oth);
int getPrice() const { return price; }
string getName() const { return name; }
... |
715f3942544da0c4b547457f61234709fa306f5e | cb84ab14e47cc88f056608f018a415fda7f91fa5 | alexandraback/datacollection | /solutions_5631989306621952_0/C++/coreyche/QR1.cpp | C++ | cpp | 728 | no_license | // QR1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<string> words;
string input;
void process(string ori, int i)
{
if (i == input.length() - 1)
{
words.pu... |
b575c243e95faee7565d40d7a33f76ae410f2955 | 2e0f13f124ef58bb238ab764dea71aa2d5bf4db6 | liangqi1983/UlordChain | /src/qt/bitcoinamountfield.cpp | C++ | cpp | 8,267 | permissive | // Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bitcoinamountfield.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include "qvaluecombobox.h"
#include <Q... |
9f578029304076f5877bafa2e886ef283e8acf47 | 091745696dc1f5ed79d5a02c22690ba4742bb12d | hllj/Codeforces | /463C.cpp | C++ | cpp | 1,658 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(false); cin.tie(0);
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
const int INF = (int) 1e9;
const ll LINF =... |
00613a02074797a20d443f80ab8c3860b785d44e | 744273579a516bcf809ed7bc8e50a8a57e8bcff1 | mobiusteapot/LightbulbProject | /Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/GripScripts/GS_GunTools.cpp | C++ | cpp | 18,401 | permissive | // Fill out your copyright notice in the Description page of Project Settings.
#include "GripScripts/GS_GunTools.h"
#include "VRGripInterface.h"
#include "GripMotionControllerComponent.h"
#include "VRExpansionFunctionLibrary.h"
#include "IXRTrackingSystem.h"
#include "VRGlobalSettings.h"
#include "VRBaseCharacter.h"
#... |
e3e59d08caf5710b001ffa061b252a6aa44ca715 | 6c5b2883de2125330c32f2a5edbf3d66bc4bc84a | zcg19/ProcmonProject | /ProcmonProject/ThreadPool.cpp | C++ | cpp | 4,065 | no_license | #include "ThreadPool.hpp"
#include "trace.h"
#include "ThreadPool.tmh"
#define TERMINATION_SIGNALED_EVENT 0
#define ITEM_ENQUEUED_NOTIFICATION_EVENT 1
ThreadWorkerItem::ThreadWorkerItem(
_In_opt_ std::shared_ptr<ThreadContext> Context,
_In_ std::function<void(std::shared_ptr<ThreadContext>)> Callback
) : co... |
134b29859ea3f5290cc1dbe2596b1b99af70bd9c | d74d09655dba281c8a32a286f2c19087d4d54bfc | Adityasharma15/Codeforces | /Edu 87 div2/B.cpp | C++ | cpp | 771 | no_license | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll t;
cin >> t;
while(t--)
{
string s;
cin >> s;
ll len = s.length();
ll a = -1, b = -1, c = -1;
ll ans = INT_MAX;
ll temp;
for(ll i = 0; i<l... |
1d51c2d94087a2b60e3f9071a1dad4283825a0f2 | bea1980b09b111323349f8df0f4e6520004b6461 | WarpspeedSCP/godot | /editor/editor_about.cpp | C++ | cpp | 10,462 | permissive | /*************************************************************************/
/* editor_about.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... |
843ce6d1a54b84139de55b3d4d252abfd4996cdf | dc6ed8d62714563324ca5974109a681c70181b20 | mgh3326/iridium-browser | /third_party/blink/renderer/platform/graphics/compositing/content_layer_client_impl.cc | C++ | cc | 9,028 | permissive | // Copyright 2015 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 "third_party/blink/renderer/platform/graphics/compositing/content_layer_client_impl.h"
#include <memory>
#include "base/optional.h"
#include "ba... |
e9bcc4f0e9d01f317c5967e16582b3d3be289cf7 | bb85c8e69a5f5343cdb68d84fa2f0f94b6b5d67b | botio/ps-01 | /lib/PCF8574/src/PCF8574.cpp | C++ | cpp | 11,605 | no_license | /*
* PCF8574 GPIO Port Expand
* https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Renzo Mischianti www.mischianti.org All right reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of ... |
49bb16579e100dad8c6c680e99f96969c21210f6 | 286315a6b7602be1f3e13ba4ff424c28644fff7a | karkhileshardul/Real-Time-Rendering-Code-Snippets | /OpenGL_On_Windows/Native/FFP/July16/24-MulticolourTriangle_Perspect/Template.cpp | C++ | cpp | 6,792 | no_license | #include<Windows.h>
#include<gl/GL.h>
#include<gl/GLU.h>
#define WIN_WIDTH 800
#define WIN_HEIGHT 600
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"glu32.lib")
HWND ghwnd;
bool bDone = false;
bool gbActiveWindow = false;
bool gbEscapeKeyIsPressed = false;
bool gbFullscreen = false;
DWORD dw... |
59a47a95765781eb94736610b7ac6173858c43a1 | 53a05a91a928f8360b29678da7551dd89a867624 | siepkes/envoy-smartos | /source/common/http/conn_manager_utility.cc | C++ | cc | 23,477 | permissive | #include "common/http/conn_manager_utility.h"
#include <atomic>
#include <cstdint>
#include <string>
#include "envoy/type/v3/percent.pb.h"
#include "common/common/empty_string.h"
#include "common/common/utility.h"
#include "common/http/conn_manager_config.h"
#include "common/http/header_utility.h"
#include "common/h... |
b816b13b5d42c2ac56d1b5b582f661a1cd78fddd | 4c2323a439bc7d478c62af5f804ccc7b6948eacd | davidc1/SNCompression | /Compression/CompressionStudyBaseline.cxx | C++ | cxx | 3,303 | no_license | #ifndef COMPRESSIONSTUDYBASELINE_CXX
#define COMPRESSIONSTUDYBASELINE_CXX
#include "CompressionStudyBaseline.h"
namespace compress {
CompressionStudyBaseline::CompressionStudyBaseline()
: CompressionStudyBase()
, _base_tree(nullptr)
, _model(nullptr)
{
if (_base_tree) { delete _base_tree; }... |
c03d6cdf16dc386576e0592982b1c46466799769 | f3f740613e7f315610585e4b6dc8bb57ae4f3b80 | jlgm/Algo | /others/uva/u10038.cpp | C++ | cpp | 1,087 | no_license | #include <cmath>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <queue>
#include <vector>
#include <string>
#include <stack>
#include <utility>
#include <list>
#include <map>
using namespace std;
#defin... |
38c7a27a1895ee6da8fd66f14f35ea3259c8eecc | 0a37656a6cedc95afc10cf87410601c67441408e | duki994/G900H-Platform-XXU1BOA7 | /vendor/samsung/common/packages/apps/SBrowser/src/sync/engine/commit.cc | C++ | cc | 5,488 | permissive | // Copyright 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 "sync/engine/commit.h"
#include "base/debug/trace_event.h"
#include "sync/engine/commit_processor.h"
#include "sync/engine/commit_util.h"
#inclu... |
5947db29b94ecd2847331963e4cb353bc0d0b65e | 1cc28c7e4c27c8097a8a64b7d0dc89bca01c5050 | kevinmiles/bluetoe | /tests/test_tools/test_radio.cpp | C++ | cpp | 20,082 | permissive | #include "test_radio.hpp"
#include "hexdump.hpp"
#include <boost/test/unit_test.hpp>
namespace test {
std::ostream& operator<<( std::ostream& out, const advertising_data& data )
{
out << "at: " << data.schedule_time << "; scheduled: " << data.transmision_time << "; channel: " << data.channel;
... |
f91c9197dfe2a4082928341550bf9c79894cc4ef | 286ae29476259c9a74c85ead6fdd07b5f57e8c2f | akosblack/Sudoku_cpp | /main.cpp | C++ | cpp | 9,428 | no_license | #include <iostream>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <chrono>
#include "Consts.h"
#include "Render.h"
#include "Brain.h"
#include "Text.h"
#include "Class_Sudoku.h"
int main(int argc, char*argv[])
{
SDL_Sur... |
c0e2d6b9b6d0c72541a0c2f26fa2e1042de99bc3 | 5052999b465c5dd4419c71d7d6b73e9f15bde0e2 | MortezaRamezani/booksim2-stt | /src/allocators/allocator.cpp | C++ | cpp | 13,048 | no_license | // $Id$
/*
Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University
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 must retain the above copyright... |
21f63706a638679dc1300ef62cb24b901c0647e1 | 47eb30916eaca28213f855727352861f2d9410c1 | danpeng-ocean/taichi | /examples/chi_examples/main.cpp | C++ | cpp | 10,002 | permissive | #include <bits/stdc++.h>
#include "taichi/ir/ir_builder.h"
#include "taichi/ir/statements.h"
#include "taichi/program/program.h"
void run_snode() {
/*
import taichi as ti, numpy as np
ti.init()
#ti.init(print_ir = True)
n = 10
place = ti.field(dtype = ti.i32)
ti.root.pointer(ti.i, n).place(place)
@t... |
989d353d1ad06c2c53c25e3b7fbd4a43ed3a6642 | 5d2789cbbcfb60af9fe8d23c59bad616e9ec5536 | mzhinf/pat | /1067. Sort with Swap(0,) (25).cpp | C++ | cpp | 605 | no_license | #include <cstdio>
#include <algorithm>
using namespace std;
int pos[100005];//pos[i] = j; i pos is j
bool vis[100005];
int main(){
int n, v;
scanf("%d", &n);
for(int i = 0; i < n; i++){
scanf("%d", &v);
pos[v] = i;
}
int sum = 0;
for(int i = 0; i < n; i++){
... |
25610d14d01e3fd1465fbef397c39fef339f60a5 | 52a1163f9302da47c047572d21f984c44da794c6 | smart--petea/DataStrucuresCpluspluswithSTL | /threeDVector.cpp | C++ | cpp | 1,066 | no_license | #include <iostream>
#include <sstream>
using namespace std;
struct ThreeDVector
{
double x;
double y;
double z;
};
void initialize(ThreeDVector& thr, double x = 0, double y = 0, double z = 0)
{
thr.x = x;
thr.y = y;
thr.z = z;
}
void read(ThreeDVector& thr, istream& in)
{
double x, y, z;... |
572b2f2b1dac14127f9b791cd825c2c540e8621f | f7767154340f373d3edce2b6a0ec34e840fdbd7f | makhdumi/Oponn | /Oponn/dllmain.cpp | C++ | cpp | 430 | no_license | // dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "oponn.h"
#include "ioponn.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.