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 |
|---|---|---|---|---|---|---|---|---|
d0957aef3c15c7293b8ba7ecc73a9146cefe7605 | ca698a1367453d13fa1aa1788dbbfc76de95d0a8 | tuogy/usaco-solutions | /fact4.cc | C++ | cc | 1,038 | no_license | /*
USER: guobich1
TASK: fact4
LANG: C++
*/
#ifndef __clang__
#include <bits/stdc++.h>
#endif
#include <iostream>
#include <fstream>
using namespace std;
struct Int {
int fact2;
int fact5;
int x;
};
Int convert(int n) {
Int ret;
ret.fact2 = ret.fact5 = 0;
while (n % 2 == 0) ret.fact2++, n... |
38580813f879a126577333e174b8bb07a6e2edf9 | a76522fe602a49acd694938b2adb10eb439e8cfd | donovan680/c-mon | /third_party/soci/backends/oracle/standard-use-type.cpp | C++ | cpp | 13,702 | permissive | //
// Copyright (C) 2004-2007 Maciej Sobczak, Stephen Hutton
// 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_ORACLE_SOURCE
#include "soci-oracle.h"
#include "blob.h"
#include "error.h"
... |
cdcf183473c80a0f8e5184803cbeb897e1a95960 | dfa05c51daa40fbf8c2d3712d19a6bde18f742d0 | scissor-project/open-scissor | /docker/d-streamon-master/d-streamon/streamon/bin/blockmon_bak_bak_bak.cpp | C++ | cpp | 2,190 | permissive | #include<CompositionManager.hpp>
#include<PoolManager.hpp>
#include<TimerThread.hpp>
#include <limits.h>
#include <signal.h>
#include <unistd.h>
#include <fstream>
#include <dlfcn.h>
#define PID_FILE "streamon.pid"
using namespace bm;
void signal_USR1( int signum )
{
std::cout << "Interrupt signal (" << signum <<... |
de49ece0c837373fbe1f9d2df89022715681de9e | f371823ef780e5ccc182c7cf8248e7f56d2f26c2 | babouin77/rallyraid | /MenuPageSetup.cpp | C++ | cpp | 13,510 | no_license |
#include "MenuPageSetup.h"
#include "MenuPageStage.h"
#include "TheGame.h"
#include "stdafx.h"
#include "WStringConverter.h"
#include "ConfigDirectory.h"
#include "EventReceiver.h"
#include "Settings.h"
#include "KeyConfig.h"
#include "Player.h"
#include "FontManager.h"
#include "Competitor.h"
#include <a... |
e230d9aad80d87ae6a2e162c4abddc2b9ff3f80f | ed2ee32abd666242eff25cb6bbaab8d2fb7cf9f5 | dublet/KARR | /src/SerialConnection.cpp | C++ | cpp | 2,927 | permissive | /**
* Project
* # # # ###### ######
* # # # # # # # #
* # # # # # # # #
* ### # # ###### ######
* # # ####### # # # #
* # # # # # # # #
* # # # # # # # #
*
* Copyright (c) 2014, Projec... |
9e23f610587dde130d36045adc3dcafb8f50dfd2 | 96d0898396257e44ec6a18e6a8ac0abfe352a04c | jrallo/hMailServer | /trunk/source/Server/Common/BO/FetchAccountUIDs.cpp | C++ | cpp | 1,496 | no_license | // Copyright (c) 2010 Martin Knafve / hMailServer.com.
// http://www.hmailserver.com
#include "StdAfx.h"
#include ".\fetchaccountuids.h"
#include "../Persistence/PersistentFetchAccount.h"
#include "../Util/Time.h"
#include "FetchAccountUID.h"
#ifdef _DEBUG
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__... |
47aaaa2a1955126c6b0f69bcd95ac12d0f59cce4 | 58e4a2f824fcfd50435a50ba0066596bc3fc07da | TeamVault/tauCFI | /C++ Benchmark Programs/Benchmark Files 1/classtester/autogen-sources/source-6456.cpp | C++ | cpp | 2,591 | no_license | struct c0;
void __attribute__ ((noinline)) tester0(c0* p);
struct c0
{
bool active0;
c0() : active0(true) {}
virtual ~c0()
{
tester0(this);
active0 = false;
}
virtual void f0(){}
};
void __attribute__ ((noinline)) tester0(c0* p)
{
p->f0();
}
struct c1;
void __attribute__ ((noinline)) tester1(c1* p);
struct c1
{
bool ac... |
c43543f6213ea38850ba79d07cf8553d123b4ec6 | 2cdb86c9223113d91fe83752e03b59dcde16de62 | brycelelbach/nt2 | /modules/libc/bench/scalar/ceil.cpp | C++ | cpp | 1,206 | permissive | //////////////////////////////////////////////////////////////////////////////
/// Copyright 2003 and onward LASMEA UMR 6602 CNRS/U.B.P Clermont-Ferrand
/// Copyright 2009 and onward LRI UMR 8623 CNRS/Univ Paris Sud XI
///
/// Distributed under the Boost Software License, Version 1.0
/// ... |
57a3691df7118b33ccf5abe3054b97b8f6b3dedc | 99697c3e46039f390c963d84b01b1d6735b4f610 | fujunwei/dldt | /inference-engine/src/vpu/graph_transformer/src/frontend/detect_network_batch.cpp | C++ | cpp | 6,882 | permissive | // Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vpu/frontend/frontend.hpp>
#include <vector>
#include <memory>
#include <string>
#include <set>
#include <map>
#include <details/caseless.hpp>
#include <details/ie_cnn_network_iterator.hpp>
#include <cpp/ie_cnn_network.h... |
a6d52aa794076f9f8d57fddda1a263197d09d3a5 | 16d4a6dd514e51f9af271c6d8a68f0e20719be8a | QPC-database/aws-sdk-cpp | /aws-cpp-sdk-elasticmapreduce/source/model/Ec2InstanceAttributes.cpp | C++ | cpp | 8,477 | permissive | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/elasticmapreduce/model/Ec2InstanceAttributes.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namesp... |
43694b08bf8f14f4d4660ca64c6c4170782a307e | 686e6b43f50e8a806ed6c73d6daeddb6bac4bbf1 | belyalov/envoy | /test/extensions/bootstrap/internal_listener/client_connection_factory_test.cc | C++ | cc | 7,131 | permissive | #include "envoy/buffer/buffer.h"
#include "envoy/event/file_event.h"
#include "envoy/network/listen_socket.h"
#include "source/common/buffer/buffer_impl.h"
#include "source/common/common/fancy_logger.h"
#include "source/common/network/address_impl.h"
#include "source/extensions/bootstrap/internal_listener/client_conne... |
6c99be6797187b3c3333b613a83651f10adc54cc | 1604bd65e0906f860ad7cf82841051562bf99525 | DhairyaShah01/Competitive-Programming | /CodeForces/A_Petya_and_Strings.cpp | C++ | cpp | 441 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
string s1,s2;
cin >> s1 >> s2;
transform(s1.begin(), s1.end(), s1.begin(), ::toupper);
transform(s2.begin(), s2.end(), s2.begin(), ::toupper);
if(s1.compare(s2) == 0) {
cout << "0" << endl;
}
else ... |
83852feeea7aad4c31ad12a06711c82010fca885 | 4accae5191a20c017657a43592b1a385422f6bf0 | strategist614/ACM-Code | /刷题比赛/kuangbin专题/数论基础/lightoj1035.cpp | C++ | cpp | 1,507 | no_license | /*
独立思考
一个题不会做,收获5%,写了代码10%,提交对了30%,总结吃透了这个题才是100%.
*/
#include<bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x)
{
x = 0;
char c = getchar();
int sgn = 1;
while (c < '0' || c > '9') {if (c == '-')sgn = -1; c = getchar();}
while (c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar();... |
7a485a440dd60052f6702c2fd4dab409d7a953e5 | 5954ecbad3fc6e99a152f3d6c03034d21af25a4c | terrylll/EE590 | /hw3/p2/test/9.cc | C++ | cc | 258 | no_license | #include "test.hh"
#include "Complexnum.hh"
// Part ix: Raising e to the power of a given complex number
int main ( ) {
Complexnum a(0,pi);
Complexnum b(6,-5);
Complexnum c;
// Test 1:
c = powerofe(a);
cout <<"\n"<< c << endl;
SUCCEED;
}
|
48cccedb0aa0d12677a0367c777eac93e32ae87c | 30b1bb45fda3fcf4ab90908bbd2352a1997e81d5 | wxyhhh/pat-advanced | /1095网上的.cpp | C++ | cpp | 3,720 | no_license | //44622 18633
#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#include<set>
#include<algorithm>
#define maxn 10050
using namespace std;
struct node2 //每个车的状态
{
string id; // 车牌
int state; // 1:in 0:out
int sum;
int in_time;
int loc; ... |
bd0aaa5a16bea967a0d78a40708fe93cba0f9951 | 4a77abb4b82a8cdc1856d42257c80a2c67d0db2b | blowery/phantomjs | /src/qt/src/3rdparty/webkit/Source/WebCore/generated/JSPopStateEvent.cpp | C++ | cpp | 8,612 | permissive | /*
This file is part of the WebKit open source project.
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation... |
8e6004d29b2bb9e096371bcc110baf2b97510d11 | ae6e2be78f1af31da263c14b9d1f67914d901753 | chancelee/MyProject | /MyPCHunter/bk/MyTaskmgr/MyGDT.cpp | C++ | cpp | 5,830 | no_license | // MyGDT.cpp : implementation file
//
#include "stdafx.h"
#include "MyTaskmgr.h"
#include "MyGDT.h"
#include "Function.h"
#include "MyDef.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//... |
236c57929fab713310faa0e657d87badfa59ba9e | 6ef9d4f4eea0974ff34a5acbe783ba1f9f639105 | andyb7846/AlienSwarm | /src/game/server/netpropmanager.cpp | C++ | cpp | 23,583 | no_license | //========= Copyright Valve Corporation, All rights reserved. ==============================//
//
// Purpose: Gets and sets SendTable/DataMap networked properties and caches results.
//
// Code contributions by and used with the permission of L4D2 modders:
// Neil Rao (neilrao42@gmail.com)
// Raymond Nondorf (rayman110... |
3a9e88b99fbd7a8d74add9aad08107da954aa7ee | 42c647018c012b043a87df926421d70e56c52317 | InternityFoundation/DS-Algo_Aman-Goyal | /Programming Questions/Day 1/First Bad Version.cpp | C++ | cpp | 1,223 | no_license | /*You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
Suppose you have n versions [1, 2, ..., n] an... |
fa277030d8a5a6b0ef0168e3ba3e3b69338d17a1 | d59e55277972e8351aa6562447be9e40055a72e0 | libooo/hifi | /interface/src/ui/overlays/Image3DOverlay.cpp | C++ | cpp | 6,733 | permissive | //
// Image3DOverlay.cpp
//
//
// Created by Clement on 7/1/14.
// Modified and renamed by Zander Otavka on 8/4/15
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "Im... |
e3e0250fc87a5aa11c94e9103190334683ef5b4a | aeb608a152244656b53588c9df05d98e3b3e499f | bellaj/Rcoin | /src/wallet/rpcwallet.cpp | C++ | cpp | 155,897 | permissive | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Readercoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "amount.h"
#include "base58.h"
#include "chain.h"
#include "consensus/vali... |
31895bf6f98c480d746a997a36d8efa3e6cf0342 | 81f6f33058ae6c73c5def1ccf79225c10fa92afe | Rituresh143/DSA-Practice | /algo/dynamic-programming/longest-bitonic-subsequence.cpp | C++ | cpp | 671 | no_license | #include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int a[n];
int lis[n];
int lds[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
lis[i]=1;
lds[i]=1;
}
for(int i=1;i<n;i++)
{
for(int j=0;j<i;j++)
{
... |
338d2b40405f94553aa136536d9bf3ecbfb82ea4 | af3baa9b12dcf49fc093d504f5225b48aa48b47e | Blast07/Leetcode | /maximum-xor-of-two-numbers-in-an-array.cpp | C++ | cpp | 1,934 | no_license | class Solution {
public:
struct TrieNode{
//end is not required in this case
TrieNode *zero;
TrieNode *one;
TrieNode(){
zero = NULL;
one = NULL;
}
};
void insert(TrieNode *root, int num, int i){
if(i<0)
return;
else{
TrieNode *newNode = NULL;
int bit = (num>>i) & 1;
if(bit){
if (root->on... |
f011ec833f0e982cc9cae91b20c46e447cc40b91 | cd9f7de8e34106de1f389df1c4bfd211d2b8d5e1 | FedorBel/yandex-cpp-course | /Coursera/Коричневый пояс/Неделя 3/Чтение из файла/Чтение из файла/Source.cpp | C++ | cpp | 457 | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <list>
#include <set>
#include <fstream>
#include "json.h"
using namespace std;
int main()
{
ifstream in("text.txt");
if (in.is_open())
{
cout << "File opened" << endl;
auto doc = json::Load(in);
for (const ... |
bc8eb737621551a0abeb22db269ac16577fa4196 | 9b888d34c68cf80748f9f38e63a08c7155ed9dd5 | lucien-tronlab/odyssey | /libraries/protocol/include/odyssey/protocol/odyssey_virtual_operations.hpp | C++ | hpp | 7,284 | no_license | #pragma once
#include <odyssey/protocol/base.hpp>
#include <odyssey/protocol/block_header.hpp>
#include <odyssey/protocol/asset.hpp>
#include <fc/utf8.hpp>
namespace odyssey { namespace protocol {
struct author_reward_operation : public virtual_operation {
author_reward_operation(){}
author_reward_ope... |
ab3dcf91f337efb07a1755cc066042b8d6ba92e0 | 2df7a2076e8625ee9627afa5e727a278075e5bb8 | shanhaobo/Whimsy | /Src/WIZ_Library/Include/04_Math/01_Basic/Vector/WizMathVector3.hpp | C++ | hpp | 13,927 | no_license | #ifndef __WIZ_MATH_VECTOR3_HPP__SHANHAOBO_19800429__
#define __WIZ_MATH_VECTOR3_HPP__SHANHAOBO_19800429__
#include "../../00_Utils/WizMathUtils.hpp"
#include "./WizMathVector3Base.hpp"
#include "./WizMathVector3Method.hpp"
#include "./WizMathVector2.hpp"
namespace Wiz
{
namespace Vector3
{
template<... |
c813814d4a8bc2ed045fad16fe7d5f4f20b85cdb | 34f69cb4b8342d0b12abcaf76baa07df83a0dcc4 | MinuLoL/Algorithm | /modifying/transformCalculate.cpp | C++ | cpp | 901 | no_license | #include<bits/stdc++.h>
using namespace std;
int Plus(int left,int right)
{
return left+right;
}
int main()
{
vector<int> v1;
v1.push_back(10);
v1.push_back(20);
v1.push_back(30);
v1.push_back(40);
v1.push_back(50);
vector<int> v2;
v2.push_back(1);
v2.push_back(2);
v2.push_back(3);
v2.push_back(4);
v2.... |
ed23f0866ba80978ab2f1213fe1b2d021334d57b | 0ebb4a389b3ee3ac989a9506a4cdfe641eb1b30e | LuckasMacedo2/Estrutura-de-Dados | /Estruturas de Dados/ListaEncadeada/testalista.cpp | C++ | cpp | 4,274 | no_license | #include "testalista.h"
#include <iostream>
using std::cout;
using std::cin;
Aluno * TestaLista::criaAluno(){
string nome, mat;
Aluno *obj = new Aluno;
No *no = new No;
cout<<"\nInforme o nome do aluno: ";
cin>>nome;
obj->setNome(nome);
cout<<"\nInforme o número de matricula d... |
9c495db7ff5fc4e7c0007a49fef9340b634e4d05 | b8d330780c270f246d8b440a24c34db0b6190472 | LiaOkami/missileCommand2 | /include/Missile.hh | C++ | hh | 1,192 | no_license | #ifndef _MISSILE_HH_
# define _MISSILE_HH_
# include "Object.hh"
class Missile : public Object
{
private:
float _speed;
Position _posEnd;
double _angle;
public:
/** \brief Constructeur par défaut
*
* \param float speed :Vitesse du missile
* \param Position posBegin :Position ... |
47f2ba84d21bad33cd37c7edd10ae94ea6de692d | b3db5c6928924c2cdbc3ae780775d15fc846a54b | 226526/PAMSI-1 | /podczas_lab/src/main.cpp | C++ | cpp | 1,407 | no_license | //============================================================================
// Name : main.cpp
// Author : Michał Wieczorek (ale merga dodal Artur Szafraniak)
// Version : 4.1
// Copyright :
// Description : Mergesort - implementacja na dynamicznej tablicy
//======================================... |
605cda2f39c99e99e7eacd222162844cae7e69dc | b13d34c82f14b9d256a35c330b6be49966140695 | blockchain-albachain/albachain-App | /build/iOS/Preview/src/_root.login.cpp | C++ | cpp | 71,571 | no_license | // This file was generated based on /Users/jaeyounchae/Desktop/albachain-App/build/iOS/Preview/cache/ux15/login.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#include <_root.albachain_bundle.h>
#include <_root.albachain_FuseControlsNavigationControl_Active_Property.h>
#include <_root.albacha... |
b4f16bf81ed410359bc35aeb8137f975979a26f3 | 403a8400276e566b46c321c175bb85eef3c833a9 | mzry1992/workspace | /OJ/USACO/The Clocks.cpp | C++ | cpp | 2,035 | no_license | /*
ID: muziriy3
PROG: clocks
LANG: C++
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <deque>
using namespace std;
int a[9];
struct node
{
int a[9];
string step;
};
deque<node> Q;
bool hash[300000];
const string c[9] = {"ABDE","A... |
4898ba48c8628a42e3026394a252612d44e333b7 | 046645ee00371b4eef0fc6a5e3a7e555751668b8 | AdrianGuo/MQTT-hc | /Libraries/Value/ValueWord.hpp | C++ | hpp | 1,506 | no_license | #ifndef VALUE_WORD_HPP_
#define VALUE_WORD_HPP_
#include "Typedefs.h"
#include "Value.hpp"
class ValueWord : public Value {
private:
u16_t m_wValue;
public:
ValueWord(u16_t wValue = 0);
virtual ~ValueWord();
u16_t GetValue() const;
void_t SetValue(u16_t wValue);
ValueWord& operator= (ValueW... |
80e7f24d1b41e4ea5c7ea2aba9fec968c0b6f3cb | b33d772ae0ae50fab50525912e53a0faaf7ca900 | jfmherokiller/TheOuterWorldsSdkDump | /Indi/SDK/Indi_Helmet_CorpTrooper_CP_T2_parameters.hpp | C++ | hpp | 371 | no_license | #pragma once
// TheOuterWorlds SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "Indi_Helmet_CorpTrooper_CP_T2_classes.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Parameters
//-----------------------------------------------------------------------... |
bebada4e824c626b90187d64509e55036668134b | 53fc8af4750fa6927810c328bbc96b52d7292a66 | riakymch/exblas | /src/mic/blas1/ExSUM.MIC.hpp | C++ | hpp | 7,066 | no_license | /*
* Copyright (c) 2016 Inria and University Pierre and Marie Curie
* All rights reserved.
*/
/**
* \file ExSUM.MIC.hpp
* \brief Provides a set of routines for working with vector types on MIC.
* For internal use
*
* \authors
* Developers : \n
* Roman Iakymchuk -- roman.iakymchuk@lip6... |
35a86339e94a4fdc6385cdf053db13c154e4f596 | 664378c556f40d9c33a89c2d8e096102fe9bd12a | Beisenbek/PP12017 | /Midterm/solutions/midterm2017_74/G/001088-midterm2017_74-G.cpp | C++ | cpp | 244 | no_license | #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int n,a[1007],l,r;
cin>>n>>l>>r;
for (int i=1;i<=n;++i)
cin>>a[i];
reverse(a+l,a+r+1);
for (int i=1;i<=n;++i)
cout<<a[i]<<" ";
}
|
11b55da5e9d39a60f5efea2900788318af5379e4 | 2237813db080026a401414bf77b8e89018465832 | huxiangdong/mixr | /include/mixr/base/colors/Hls.hpp | C++ | hpp | 2,021 | no_license |
#ifndef __mixr_base_colors_Hls_HPP__
#define __mixr_base_colors_Hls_HPP__
#include "mixr/base/colors/Color.hpp"
namespace mixr {
namespace base {
class Number;
//------------------------------------------------------------------------------
// Class: Hls
// Description: Defines a color by Hue, Saturatio... |
2125eb8b8c160f8e507d338c8848e858a4619195 | 6942488e4c741ea67cf426428e0ffcf17e9d0160 | Conny14156/OneFlowerMirroed | /Project/Model/SpriterOverride/SFMLobjectfactory.cpp | C++ | cpp | 756 | no_license | #include "SFMLObjectFactory.h"
#include "sfmlpointinstanceinfo.h"
#include "sfmlboxinstanceinfo.h"
#include "sfmlboneinstanceinfo.h"
#include "sfmlsoundobjectinforeference.h"
namespace SpriterEngine
{
SFMLObjectFactory::SFMLObjectFactory(SpriterTextureMapper *validTextureMapper) :
textureMapper(validTextureMapper)... |
ea2a29d740c3a64547446dcb1938f88f168bd76f | b0b80fc25dda0fc87598661cc2cc865ae6665cb6 | wjw136/course_designing_project | /compiler/.history/lab1/lexical_20210414202533.cpp | C++ | cpp | 6,864 | no_license | #include <iostream>
#include <windows.h>
#include <string.h>
#include <queue>
#include <math.h>
#include "stdio.h"
#include <fstream>
#define ll long long
#define inf 100000
#define clr1(a) memset(a, -1, sizeof(a))
#define clr(a) memset(a, 0, sizeof(a))
using namespace std;
//reserved word
static char reserveword[35][... |
6e6f9a6984bd0ca32cdece5a01e70056ec1581c5 | b5717b72a7366a1791471e39317185612ccdfe2d | lexingsen/Data-Structure | /Queue/Queue3.cc | C++ | cc | 1,279 | no_license | #include <bits/stdc++.h>
using namespace std;
const int N=10;
// 标志法 tag=0 队空 tag=1 队列满
class CircleQueue {
private:
int data[N];
int front, rear;
bool tag;
public:
CircleQueue() {
memset(data, 0, sizeof(data));
rear = front = 0;
tag=0;
}
~CircleQueue() {
}
int... |
72162cdedcd0fefb7bcd3c957c771bf1fc14bd2c | 989d6d581b7f8aaaaa2ab48167b10c855bbeed70 | arnoldjair/pruebaCPPAranda | /main.cpp | C++ | cpp | 839 | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <regex>
#include "lib/boost/filesystem.hpp"
#include "lib/boost/filesystem/fstream.hpp"
#include "zlib.h"
#include "log.h"
#include "sqlite3.h"
#include "db.h"
using namespace std;
int main(int argc, char **argv){
if(argc == ... |
7df86957dea74c08ac7e0447272f9c0c00c80912 | ffa773a77942615c371d9decd9030317681ce94b | lijieumn/bogus-interface | /interface/src/TotalContact.cc | C++ | cc | 9,386 | no_license | #include "TotalContact.hh"
#include "ClothFrictionData.hh"
#include "SolverOptions.hh"
#include "SolverStats.hh"
#include "RevCoulombLaw.hh"
#include "NodalGaussSeidel.impl.hh"
#include <fstream>
using namespace std;
#include <bogus/Core/Block.impl.hpp>
#include <bogus/Core/Block.io.hpp>
#include <bogus/Core/BlockSol... |
bec5e882588a6df45d7a63fb98f123490450fd5c | be69e257bab23507759dbcdb3b8ddacfe1e625c2 | x327397818/UDC-Term2-project3 | /particle_filter.cpp | C++ | cpp | 9,799 | permissive | /*
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
#include <random>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <math.h>
#include <iostream>
#include <sstream>
#include <string>
#include <iterator>
#include "particle_filter.h"
using namespace std;
... |
4da3e75dfe38743ab53d9544877d1afb93b21aab | 107123d88daf2d6e732bc6e6266934362f75fa89 | nikeshsraj10/parallel-programming-multithreading | /sharedFuture.cpp | C++ | cpp | 507 | permissive | // promise example
#include <iostream> // std::cout
#include <functional> // std::ref
#include <thread> // std::thread
#include <future> // std::promise, std::future
using namespace std;
int getVal(){
return 10;
}
int main()
{
future<int> fut = async(getVal);
shared_future<int> shfut = fut.share();
int i = 0;
whi... |
837918c0e439ff57f88c0d58637d403806f45b58 | 6425688139d4954f3387e9c44b89f8b0eb557d00 | BitRushTeam/BitRush | /src/miner.cpp | C++ | cpp | 19,861 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2013 The NovaCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "txdb.h"
#include "miner.h"... |
dcd22406ced112918f5a104fd73b4504a6f6f374 | 90d67b62d98ddc88536b04b7e51b9dd3e106661c | thomasfannes/treeDAG | /treeDAG/separation.hpp | C++ | hpp | 1,038 | permissive | #ifndef TREEDAG_SEPARATION_HPP
#define TREEDAG_SEPARATION_HPP
#include <limits>
#include <vector>
#include "separatorConfig.hpp"
namespace treeDAG {
struct Separation : public SeparatorConfig
{
void limitToMaximalComponents();
VertexSet separator;
ComponentMap componentMap;
ComponentSet components;... |
cf52cb22022e35202e9ecfa043dfc63bb19a81cf | e172736d6f0c35489d4d104a25d95f3c7e8a066e | Ahmad232324/serenity | /Kernel/Time/HPETComparator.cpp | C++ | cpp | 4,581 | permissive | /*
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
* 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
... |
623fb3f496cc4bfb43b1e6ee998fe00c7f2b3262 | f42627a28092e5d6f42bdad36faedd572421a626 | webOS-ports/luna-service2 | /include/public/luna-service2++/message.hpp | C++ | hpp | 4,793 | permissive | // Copyright (c) 2014-2021 LG Electronics, 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
35e9298eb01f8b27a2470d1cda4ed1a8eec91972 | 4d513ca3e61b5ed7eca2a559260c44becd305bb8 | zeerorg/OperatingSystems | /priority.cpp | C++ | cpp | 3,989 | no_license | #include <iostream>
#include "Process.h"
using namespace std;
struct ProcessHeap {
Process q[MAX];
int length;
ProcessHeap() {
length = 0;
}
/*
1. Insert in heap
~ compare priority and move up
~ if comparing with topmost and switch occurs inside switch topmost : burst =... |
edcf87f59c913d5984ab8f18f1fc24e6252eeec1 | b8ee1aa0140f403c0a14ff82d2cc19e7107b96f0 | splintermind/Dwarf-Therapist | /src/rolestats.cpp | C++ | cpp | 5,496 | permissive | /*
Dwarf Therapist
Copyright (c) 2009 Trey Stout (chmod)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, p... |
0819fc4a8cea665f518a107f12cb89c19f3740c6 | 0d0e7aeceedf61b603fac58b197a40c136c53f03 | jazzz/gSBB | /src/legacy/GpuTestMain.cpp | C++ | cpp | 687 | no_license |
#ifndef _GPUTESTMAIN_
#define _GPUTESTMAIN_
#include <map>
#include <string>
#include <sys/time.h>
extern "C" void GPU_go();
#define DIFF(A,B){1000000*(B.tv_sec - A.tv_sec) + B.tv_usec - A.tv_usec };
long Diff(timeval tv_start, timeval tv_end){
return 1000000*(tv_end.tv_sec - tv_start.tv_sec) + tv_end.tv_usec -... |
c562d77bd4d69f27201099b0217201f83455e3a0 | 40c56066d75391cdbffe9ea3d0d34e4c5dcf6cc4 | parsa/blaze | /blazemark/src/boost/DMatDMatSub.cpp | C++ | cpp | 4,345 | permissive | //=================================================================================================
/*!
// \file src/boost/DMatDMatSub.cpp
// \brief Source file for the Boost dense matrix/dense matrix subtraction kernel
//
// Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
//
// This file is part of t... |
012889bc7ea6704547ebacd989f8b6ff5415e6c9 | d55a904a00b4e09b6d01149971d4e41e369aaeea | KiraMelody/Leetcode | /3.cpp | C++ | cpp | 623 | no_license | class Solution {
public:
int lengthOfLongestSubstring(string s) {
int hash[500];
int last = 1;
int ans = 1;
if (s.size() == 0)
return 0;
memset(hash, -1, sizeof(hash));
hash[s[0]] = 0;
for (int i = 1;i < s.length(); i++)
{
int d... |
86bfa773866444cfd37d7344116a4c40bce00e1a | b94faa35f2a282e49f6d3d03d2a270113a3d5d13 | wgnet/wds_qt | /qtbase/tests/auto/dbus/qdbuscontext/tst_qdbuscontext.cpp | C++ | cpp | 2,992 | permissive | /****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercia... |
e768303d7f90315251615734996294caadc20358 | bf3080a2e012be62d15b9aaea0768773a3375dd1 | foxhatleo/panic-painter | /source/scenes/gameplay/PPColorPaletteView.cpp | C++ | cpp | 6,389 | no_license | //
// PPColorPaletteView.cpp
// PanicPainter (Mac)
//
// Created by Ansh Godha on 3/25/21.
// Copyright © 2021 Dragonglass Studios. All rights reserved.
//
#include "PPColorPaletteView.h"
#define PALETTE_COLOR_SIZE 45.0f
/** Space between dots. */
#define PADDING 77.0
#define INACTIVE_SCALE 0.75f
#define PRESSED_... |
02545ac04ec6123b780219b4c9240384fa7d9c00 | ee3d6dd5cc512738cdeb2895856284ab4f136058 | nomadsinteractive/ark | /src/core/impl/loader/json_loader_text.cpp | C++ | cpp | 272 | permissive | #include "core/impl/loader/json_loader_text.h"
#include "core/base/json.h"
#include "core/util/strings.h"
namespace ark {
Json JsonLoaderText::load(const sp<Readable>& readable)
{
Json json;
json.load(Strings::loadFromReadable(readable));
return json;
}
}
|
c716c2605bd6285cdf36cee8d3b46404f8fa37bf | 5b7129401a118c238fa9bf8de60ed77a935a7455 | AndrewWang996/6.839-final | /Geometry/include/GeometryExploration.hpp | C++ | hpp | 1,884 | no_license | #pragma once
#include <Eigen/Dense>
#include <vector>
#include <set>
#include <iostream>
namespace geometry {
template <typename T>
using Vector3 = Eigen::Matrix<T, 3, 1>;
template <typename T>
using Vector2 = Eigen::Matrix<T, 2, 1>;
template <typename T>
using VectorX = Eigen::Matrix<T, Eigen:... |
1b8eb479fb0195659c8f09b9fdf7950597f47d77 | 25b9047d1fa3bdf004d3717607980f727d44bc45 | ly774508966/Dancy | /Pinbob/src/Score.cpp | C++ | cpp | 1,402 | no_license | /*
* Score.cpp
*
* Created on: Jul 19, 2011
* Author: Zhang Wenli
*/
#include "Score.h"
using namespace std;
Score::Score() :
perfectCount(0), wellDoneCount(0), goodCount(0),
badCount(0), missedCount(0),score(0){
combo.push(0);
}
void Score::clearScore(){
perfectCount = 0;
wellDoneCount = 0;
goodCo... |
35582d4dfef3bc2b9d73d21b34ca877710d15082 | 3b9f670207301ed2623a4ba5c6990932c6285d5d | Craigsup/Graphics | /Lab1/Lab1/Matrix.cpp | C++ | cpp | 8,653 | no_license | #include "Matrix.h"
// around 4 lines = inline
// 6 or more not inline
void Matrix::Scale(float* matrix, float sx, float sy, float sz) {
matrix[0] = matrix[0] * sx;
matrix[1] = matrix[1] * sx;
matrix[2] = matrix[2] * sx;
matrix[3] = matrix[3] * sx;
matrix[4] = matrix[4] * sy;
matrix[5] = matrix[5] *... |
4a4f60ac0432d87eda1580ec2562b4449d5cba2d | 3ef65976cc53afe3fadbe00433866f135c28f399 | chuanhanyuan/CPE553-CPP | /session11Templates/sort2020F.cc | C++ | cc | 1,144 | no_license | #include <iostream>
using namespace std;
template<typename T>
T sort(T x[], int len) { //O(n^2) //type unification T=int
for (int i = 0; i < len-1; i++) { //O(n)
for (int j = 0; j < len-1; j++) // O(n)
if (x[j] > x[j+1]) {
T temp = x[j];
x[j] = x[j+1];
... |
750dc1d712d9fc17ea192d1ba75da9a4b7934fe9 | c83aa1d122da1e112069c9f6a5500131e1cd10c1 | alexkim96/Draft | /Multipurpose Financial Calculator.cpp | C++ | cpp | 2,120 | no_license | #include <windows.h>
#include <tchar.h>
using namespace std;
#define OPTINBT1 1
#define OPTINBT2 2
#define COMBO1 3
static TCHAR szWindowClass[] = _T("win32app");
static TCHAR szTitle[] = _T("Win32 Guided Tour Application");
void addButtons(HWND hwnd)
{
CreateWindow(TEXT("button"), TEXT("P/E Ratio"),
WS_VISIBLE ... |
0a8c5bb70b25a62a3da4753e9e8ef883ab827ee8 | 876b2928812cc8b3e8c2e8b8368cf2db4b780f8f | jaguraphg/WarchaosMapper256 | /WarchaosMapperDecl.cpp | C++ | cpp | 12,390 | no_license | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <inifiles.hpp>
#include "WarchaosMapperDecl.h"
//---------------------------------------------------------------------------
//--------------------------------------------------------... |
c7c0e7ecb91dd8b2a082d6acd38cbed67f85663d | 16541d1c7336837e476000766b158447be8e5feb | Rohan-dev-C/obstaclecourse | /NeoMatrixPractice/src/obstacle.cpp | C++ | cpp | 310 | no_license | #include "obstacle.h"
void obstacle::move()
{
if(millis() - timeSinceLastMove > 100)
{
x+= xSpeed;
timeSinceLastMove = millis();
if(x >= 7 )
{
xSpeed = -xSpeed;
}
else if(x <= 0)
{
xSpeed = -xSpeed;
}
}
}
|
7358c8368b63ce71d274b05a047179db0f42b958 | b8d368835d240e9446098209fa7c3cc4027cf01d | PriyanshuSingh/CompProg | /cormen/GraphAlgorithms/exercise22_4(Reachability).cpp | C++ | cpp | 4,871 | no_license | /************************************************************
* Author: Priyanshu Singh
* Handle: tgamerz
*
* CLRS 22-4
* Let G = (V, E) be a directed graph in which each vertex u belongs V is labeled with
* a unique integer L(u) from the set {0, 1, 2, ... |V| -1}.
* For each vertex u belong V , let
* R(u) = {... |
3d7fdd4dfb5b1cce92d77700fa71e47fe7f89815 | c063e10660f73e46c9687a2b9bfc400ce232de4f | fkrafi/UVa | /357.cpp | C++ | cpp | 622 | no_license | #include<stdio.h>
int S[] = {0, 1, 5, 10, 25, 50};
double mem[30005][7];
void dp()
{
int m, n;
for(n=0; n<=30000; n++)
{
for(m=0; m<=5; m++)
{
if(!n)
mem[n][m] = 1;
else if(m-1<0 && (n-S[m])>=0)
mem[n][m] = mem[n-S[m]][m];
else if(n-S[m]<0 && (m-1)>=0)
mem[n][m] = mem[n][m-1];
else
... |
2ed292b0afdcd54328c5154bb9636061dcc02595 | bff6f76a7533be6058e83717c0ade8741cc36d12 | Ankits-lab/frameworks_base | /tools/aapt2/link/XmlCompatVersioner_test.cpp | C++ | cpp | 13,738 | permissive | /*
* Copyright (C) 2017 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 requir... |
560e5deae06e67b6471c1982cfeaf3266d7f1f8a | bf6d0ab88d27bdca7f88ac8c0932b50c76236c2e | weijietong/ClickHouse | /src/Processors/Formats/Impl/TSKVRowInputFormat.cpp | C++ | cpp | 10,059 | permissive | #include <IO/ReadHelpers.h>
#include <Processors/Formats/Impl/TSKVRowInputFormat.h>
#include <Formats/FormatFactory.h>
#include <Formats/EscapingRuleUtils.h>
#include <DataTypes/Serializations/SerializationNullable.h>
#include <DataTypes/DataTypeString.h>
namespace DB
{
namespace ErrorCodes
{
extern const int IN... |
214ee95c77d2e5c6d8f4c087b5c076b00876565b | 217cc988fa7952496bd3ffdfdbc7a66b53478ab7 | Prakhar-FF13/Competitive-Programming | /CSES/SortingAndSearching/Traffic Lights.cpp | C++ | cpp | 1,786 | no_license | #include <iostream>
#include <cstdio>
#include <string.h>
#include <climits>
#include <sstream>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <numeric>
#... |
427e6b771a92ba7480b87290715101b621f87f68 | 4983f8f0fc0e6ac58a1bb52a240799f76da55698 | Aaron0Neill/AI-Labs | /Lab1/Lab1/src/Button.cpp | C++ | cpp | 1,374 | no_license | #include "Button.h"
Button::Button(sf::Texture& t_tex, sf::Font& t_font, std::string t_name) :
m_caller(nullptr),
m_arg(AiStates::NONE),
m_func(nullptr)
{
m_text.setFont(t_font);
m_text.setString(t_name);
m_sprite.setTexture(t_tex);
m_sprite.setTextureRect(sf::IntRect(0,0,128,64));
}
//**********************... |
311ca93fe70778238ef071b44f997f4a1460dda5 | c1bd17e5199674d9366043b4814c3f8b717e0ec7 | brycelelbach/nt2 | /modules/gsl_specfun/include/nt2/toolbox/gsl_specfun/function/simd/vmx/common/gsl_sf_exp.hpp | C++ | hpp | 746 | permissive | //////////////////////////////////////////////////////////////////////////////
/// Copyright 2003 and onward LASMEA UMR 6602 CNRS/U.B.P Clermont-Ferrand
/// Copyright 2009 and onward LRI UMR 8623 CNRS/Univ Paris Sud XI
///
/// Distributed under the Boost Software License, Version 1.0
/// ... |
c170da5be67ae606819f8125b4ef7cf142f06949 | db8cd41794cc0b23af3f1155c7a302b483a50a1d | eaglesky/leetcode | /C++/RPN.cc | C++ | cc | 1,132 | no_license | #include <iostream>
#include <vector>
using namespace std;
int compute(int a, int b, const string& op)
{
if (op == "+")
return a + b;
else if (op == "-")
return a - b;
else if (op == "*")
return a * b;
else if (op == "/")
return a / b;
else
return 0;
}
int e... |
1bdcde21b888fdbdb0c412e286497f9af646b076 | 0a6f88087697a14b4392f25d3a80754b3dc5d476 | poifull10/image_registration | /src/warp.cpp | C++ | cpp | 759 | no_license | #include <warp.h>
using namespace imr;
const Vector2f Warper::warp_x(const Vector2f& x)
{
VectorXf x_tilda(3);
x_tilda << x(0), x(1), 1;
MatrixXf mat = to_mat();
mat = mat * x_tilda;
Vector2f ret;
ret << mat(0), mat(1);
return ret;
}
const Vector2f Warper::warp_x_inv(const Vector2f& x)
{
... |
41d5ef88e4407f29fdde30eb5957133c40518fdf | 058f71e4728ee12d976b7ec098e306bcf6ee152d | superducktoes/CS162 | /lab5/menu.cpp | C++ | cpp | 2,386 | no_license | /******************************************************************
*
* Author: Nick Roy
* Date: 4/6/2017
* Description: Menu class. functions take a string to display and
* then validates input.
*
* modified on 4/23/2017
*
* Sources:
* - cin.good/cin.fail: http://stackoverflow.com/questions/13440831/how-do-i... |
606682dd474e2486ddae44750277596e1474b238 | e26485d1b6b7385b7d4f9efb3d1b5a6f84d8a82e | cho-jae-seong/Algorithm | /Tallest_tower.cpp | C++ | cpp | 846 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
struct Brick {
int s, h, w;
Brick(int a, int b, int c) {
s = a;
h = b;
w = c;
}
bool operator<(const Brick& b)const {
return s > b.s;
}
};
int main(void) {
int n, a, b, c, max_h... |
58649ddb8305eee03ad89579a873ae02ada4ef03 | 6033c61b0f7921ddee32f2a90ca397e4c22e6019 | sdk-team/aliyun-openapi-cpp-sdk | /domain/src/model/ListEmailVerificationResult.cc | C++ | cc | 3,588 | 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... |
0f608dc1999b51a09fd8e1d7c49d2907df5541df | 062b385d4b29c0991c7d361b99670e2161d26b07 | BaeJuneHyuck/BaekJune | /Baekjoon/BJ2206.cpp | C++ | cpp | 1,700 | no_license | #include <iostream>
#include <string>
#include <queue>
using namespace std;
int n, m;
int arr[1001][1001];// 10 6 = 1mb
int dist[1001][1001][2];//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
int dr[4] = { 1, 0, -1, 0 };
int dc[4] = { 0, 1, 0 , -1 };
class node {
public:
int row;
int col;
... |
20975246e03cb3df9b8becb306627a739f32289e | 4a6bf1fe92b24a6b041f644dbdef91d51e3362d4 | blackketter/britepad | /src/apps/SplashApp.cpp | C++ | cpp | 2,385 | no_license | #include "SplashApp.h"
SplashApp theSplashApp;
void drawLogo(color_t c) {
int weight = 20;
int radius = 30;
int ascender = radius*2;
int midheight = screen.clipHeight() / 2;
int midwidth = screen.clipWidth() / 2;
screen.fillCircle(midwidth-radius, midheight, radius, c);
screen.fillCircle(midwidth-radius... |
4da510d52bd349769de581ad8336ec9585ab9ca6 | 6b861ff6c2bb4d42f410462f0e0fb44f848dfd04 | ashutosh0gupta/llvm_bmc | /examples/litmus/c/run-scripts/tmp_5/W+RR+WW+WR+poaa+dmb.sy+dmb.sylp+L.c.cbmc_out.cpp | C++ | cpp | 52,325 | no_license | // Global variabls:
// 0:vars:3
// 3:atom_1_X0_1:1
// 4:atom_1_X2_0:1
// 5:atom_3_X2_0:1
// Local global variabls:
// 0:thr0:1
// 1:thr1:1
// 2:thr2:1
// 3:thr3:1
#define ADDRSIZE 6
#define LOCALADDRSIZE 4
#define NTHREAD 5
#define NCONTEXT 5
#define ASSUME(stmt) __CPROVER_assume(stmt)
#define ASSERT(stmt) __CPROVER_a... |
7a54bf994ae46dff2ff1563f357becf1ae3d0360 | 90ef2daea8369367a83b65d10c8def2dfe1bf135 | d1a2tw/mbed12 | /12_1_Continuous_Servos_Test/main.cpp | C++ | cpp | 444 | no_license | #include "mbed.h"
#define CENTER_BASE 1500
PwmOut servo(D11);
void servo_control(int speed){
if (speed > 200) speed = 200;
else if (speed < -200) speed = -200;
servo = (CENTER_BASE + speed)/20000.0f;
}
int main() {
servo.period(.02);
while(1) {
/*servo_control(100);
wait(... |
97135a0c2f3e9b1974e492b99e7ff0f2ac343ca5 | b09db865bd60c394e525aa77ada91750c6931d54 | niumeng07/x-deeplearning | /xdl/ps-plus/ps-plus/common/file_system/none_file_system.cc | C++ | cc | 2,131 | permissive | /* Copyright (C) 2016-2018 Alibaba Group Holding Limited
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 ... |
55e2a40ff76c22343295ab66ab2e9fc36dc5d40c | d0aa9b6611911503ffada6a6efe8287fc46e3e2c | dongAxis/tensorflow | /tensorflow/core/distributed_runtime/coordination/coordination_service_test.cc | C++ | cc | 37,268 | permissive | /* Copyright 2021 The TensorFlow 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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
03b44cd478813f9fea1e837f5d127cce327463d5 | dbbb064797ee01eca7acafe71dafb4f37a62c468 | ttyang/sandbox | /sandbox/chrono/boost/chrono/detail/inlined/win/chrono.hpp | C++ | hpp | 4,645 | no_license | // win/chrono.cpp --------------------------------------------------------------//
// Copyright Beman Dawes 2008
// Copyright 2009-2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//------------------------------------------... |
3336f3f67b870e82ae785a96a4942719953479c9 | 7f6ad75954b9dcc659287affdbed5f882393340d | faltovaj/FCC_calo_analysis_cpp | /src/ClustersAnalysis.cc | C++ | cc | 13,495 | no_license | #include "ClustersAnalysis.h"
// podio specific includes
#include "podio/EventStore.h"
#include "podio/ROOTReader.h"
#include "datamodel/MCParticleCollection.h"
#include "datamodel/CaloClusterCollection.h"
#include "datamodel/CaloHitCollection.h"
#include "TVector3.h"
// STL
#include <vector>
#include <iostream>
#i... |
5db017dd501d4f760bae11b01b1c027ded73b0fe | dba2852cc88f45af26565be80dc26ef994cdcf2d | Dialex2006/TreasureHuntGame | /Project_work_Dmitrii_Bacherikov/Constants.cpp | C++ | cpp | 799 | no_license | //
// Constants.cpp
// A04_2
//
// Created by Dmitrii Bacherikov on 08.02.2021.
//
#include "Constants.hpp"
const char Constants::SYMBOL_GEM = '$';
const char Constants::SYMBOL_PLAYER = 'P';
const char Constants::SYMBOL_MONSTER = 'M';
const char Constants::SYMBOL_MAP_WALL = 'X';
const char Constants::SYMBOL_INSID... |
b8c4066bfbcde832312e2bfdef886a2c9fc07d90 | 4057dfe58b78941e9ce76fffe2929201a26bd61b | PeterZs/delfem2 | /src_cpp/cpp/matrix_sparse.cpp | C++ | cpp | 24,921 | permissive | #include <iostream>
#include <cassert>
#include <math.h>
#include <vector>
#include "delfem2/matrix_sparse.h"
CMatrixSquareSparse::CMatrixSquareSparse()
{
m_nblk_col = 0;
m_len_col = 0;
m_nblk_row = 0;
m_len_row = 0;
m_ncrs = 0;
m_colInd = 0;
m_rowPtr = 0;
is_dia = true;
m_valCrs = 0;
m_valDia ... |
e09719a1e9f08d190608bdfdfbc65b25c5e4934b | 1e65bfb4f7694dc987427f4bf33ebd570734a07c | Abunyawa/contests | /671/c.cpp | C++ | cpp | 3,151 | no_license | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F first
#define S second
#define vi vector<int>
#define vl vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#de... |
81b7c79251a4eb7117b5459f199673fd636d99e4 | ccb54e7ccb376c8969d37c01c0559a6bb793d130 | asmirnov69/KVAN | /cpp/src/json-io.cpp | C++ | cpp | 5,968 | permissive | #include <yajl/yajl_parse.h>
#include <kvan/json-io.h>
#include <kvan/struct-descriptor.h>
void JSONVisitor::visit_null(const LOBKey& path)
{
out << "null";
}
void JSONVisitor::visit_key(const LOBKey& path)
{
out << "\"" << path.back() << "\": ";
}
void JSONVisitor::visit_enum(const LOBKey& path, const string& e... |
1b3e4e6580035d48a219ddbbffda84fe84d1b300 | 2806b2d92e44de0347dd3c9839f71c28f8fa8742 | gerasumit/LeetCode | /Two Sum.cpp | C++ | cpp | 849 | no_license | class Solution {
public:
vector<int> twoSum(vector<int> &numbers, int target) {
// Note: The Solution object is instantiated only once and is reused by each test case.
vector<int> v;
for(vector<int>::const_iterator i = numbers.begin(); i != numbers.end(); i++)
{
vector<in... |
0f99740ddcaa29b8bf909544f2c17163d41b2785 | b2f5c45175358caadae6123aefc2937da89091af | Abhi3685/DS-ALGO | /DynamicProgramming/l002.cpp | C++ | cpp | 1,173 | no_license | #include <iostream>
#include <vector>
using namespace std;
int Q1(vector<int> &moves, int si, int ei, vector<int> &dp) {
if(si == ei) return dp[si] = 1;
if(dp[si] != 0) return dp[si];
int count = 0;
for(int move: moves) {
if(si + move <= ei) {
count += Q1(moves, si + move, ei, dp);
}
}
r... |
4ca25e0fbee48f961733ee77b302bf088d21c40e | bfd91ba4f0aa7b43c9de90dfbb447404c8ef1bd9 | mikma/gvisor | /test/syscalls/linux/setgid.cc | C++ | cc | 14,607 | permissive | // Copyright 2020 The gVisor Authors.
//
// 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 agree... |
89f3dd8639d562550a10d39c1880443abb7527a3 | ada7180f059f1603f3f6ec1122dd78103c1b89f2 | AhmedKhaledAK/problem-solving-training | /leetcode/Maximum Product of Word Lengths.cpp | C++ | cpp | 587 | no_license | class Solution {
public:
int maxProduct(vector<string>& words) {
int sz = (int) words.size();
vector<int> bitMaps(sz);
int ans, s1, s2;
ans = s1 = s2 = 0;
for (int i = 0; i < sz; i++) {
s1 = words[i].size();
for (int j = 0; j < s1; j++) {
... |
6083768f7da32181676b577401dab50ecba38c7b | 83065bf94045a95d148f1c905d13fcad2302e999 | ravi-ojha/competitive-sport | /spoj/FASHION/fashion.cpp | C++ | cpp | 394 | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf(" %d",&t);
while(t--)
{
int n;
scanf("%d",&n);
int res = 0;
int a[n];
int b[n];
for(int i=0;i<n;i++)
{
scanf(" %d",&a[i]);
}
for(int i=0;i<n;i++)
{
scanf(" %d",&b[i]);
}
sort(a,a+n);
sort(b,b+n);
for(int i=0;i<... |
c69c68bfafa0f2dae07713ec0e743ad891f3bbf1 | 4e771bd75bca496e308554f08858750a75e24fbd | tlouwers/embedded | /Algorithms/MovingAverage/test/TEST_Resize.cpp | C++ | cpp | 2,055 | no_license |
#include "../../../Catch/catch.hpp"
#include "../MovingAverage.hpp"
TEST_CASE( "resizing the internal buffer", "[MovingAverage]" )
{
// For each section variables are anew
const int SIZE = 5;
MovingAverage<int> movAvg;
SECTION( "resize" )
{
REQUIRE(movAvg.Resize(SIZE) == t... |
6fd4c45db4a0cb34975f32e1114252034e9c67f8 | c340976c925838a2b73708074077f621a7def87e | FynnGamadeyo/control-trajectory_follower | /src/SubTrajectory.hpp | C++ | hpp | 3,595 | no_license | #ifndef TRAJECTORY_FOLLOWER_SUBTRAJECTORY
#define TRAJECTORY_FOLLOWER_SUBTRAJECTORY
#include <base/Pose.hpp>
#include <base/geometry/Spline.hpp>
#include <vector>
#include <base/Trajectory.hpp>
#include <stdexcept>
#include <base/commands/Motion2D.hpp>
namespace trajectory_follower {
class SubTrajectory
{
public:
... |
1452341285805001710782450b548ba0c57558c2 | ac65fd9ec2ff20b81f7c34aa1293f53b51e8a95f | LifeIsStrange/zircon | /system/dev/audio/intel-hda/controller/intel-hda-controller-init.cpp | C++ | cpp | 25,018 | permissive | // Copyright 2017 The Fuchsia 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 <hw/arch_ops.h>
#include <limits.h>
#include <zircon/thread_annotations.h>
#include "binding.h"
#include "debug-logging.h"
#include "intel-hda-co... |
a7843cc7245da4534561042e3c4701fb74c46c9c | ee50188ec75982cd61f3d4b12cad280be82413d3 | arthurtalpaert/CDMATH | /pre_requis/INTERP_KERNEL/InterpKernelUtilities.hxx | C++ | hxx | 1,360 | no_license | // Copyright (C) 2007-2014 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This ... |
249222253fb33048ca215a3798a8106bdd325fa4 | e93e2f1d4bdc56b40bb76cc35ba892b5e6c37d8c | Seokhwan-choi/KYUNGIL_TeamPF | /메탈슬러그시작/winMain.cpp | C++ | cpp | 5,975 | no_license | //==============================================================//
// ## 헤더파일 써준다 ## //
//==============================================================//
#include "stdafx.h"
#include "mainGame.h"
//==============================================================//
// ## 전역변수 써준다 ## //
//===========... |
748ac6dee17f5ae753ad891770933ddcd6e6a8ea | dc4ca0f34d95a9ed3a13130e8d2e959a8f0ec65a | jjzhang166/WinNT5_src_20201004 | /NT/inetsrv/msmq/src/mqsec/secutils/report.cpp | C++ | cpp | 1,663 | no_license |
/////////////////////////////////////////////////////////////////////
//
// File : report.cpp
//
// NOTE: DllMain is at the end of the module
//////////////////////////////////////////////////////////////////////
#include "stdh.h"
#include <_registr.h>
#include "report.tmh"
//
// D... |
b55584896e95e4bd57bccfd4dbbff963416fb26f | 3a2bed555a952993d3440f1b5108f2e3e94d2b31 | SahilVaid4040/DSALGO | /Stack/Balanced paranthesis Question.cpp | C++ | cpp | 648 | no_license | #include <iostream>
#include <stack>
#include <cstring>
using namespace std;
//problem is to cehck wether parathesis are in order in the given string
//or not eg. ((a+b)+c) are in order but not in (a+b)) or (a+b + c))(
bool Balanceed_Paranthesis(char *s)
{
stack<char>c;
int n = strlen(s);
for(int i=0 ;i<n... |
c95d64b2e74478768b5ac836fae99b56d5b13583 | 41a82a5a231527f396e0bcd0a7b618648080a9d0 | damueller/ogs | /MeshGeoToolsLib/MeshNodesAlongSurface.cpp | C++ | cpp | 1,303 | permissive | /**
* \author Norihiro Watanabe
* \date 2014-03-14
*
* \copyright
* Copyright (c) 2012-2014, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.