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
5f46bc4f80921c9c867ebfc10dcaefdbc70129bc
e0f54b5697c5315d637ddab84f5076c351ecf5a8
doublec/self
/vm/src/ppc/asm/asm_ppc.hh
C++
hh
113,942
no_license
#pragma once # ifdef __ppc__ /* Sun-$Revision: 30.13 $ */ /* Copyright 1992-2006 Sun Microsystems, Inc. and Stanford University. See the LICENSE file for license information. */ # if defined(FAST_COMPILER) || defined(SIC_COMPILER) // these global for ease of use enum CR_Field { cr0 = 0, cr1 = 4, cr2 =...
f966fa566edee81b1290a1fed5f8a56dfec8a19b
031af97d494b1fb2c6f526b77e4b075214648a76
asimy/gosu
/src/Graphics/Texture.cpp
C++
cpp
3,266
permissive
#include <Gosu/Graphics.hpp> #include "Texture.hpp" #include "TexChunk.hpp" #include <Gosu/Bitmap.hpp> #include <Gosu/Platform.hpp> #include <stdexcept> namespace Gosu { bool undocumentedRetrofication = false; } Gosu::Texture::Texture(unsigned size) : allocator(size, size) { // Create texture name. glGenT...
64313fdbe01017ddce1ad27ed993ae0eb7e8282c
4ae8a4bcd6cc56026443048dd0d6dae584a30d32
googleapis/google-cloud-cpp
/google/cloud/osconfig/agentendpoint/v1/internal/agent_endpoint_tracing_connection.cc
C++
cc
5,090
permissive
// Copyright 2022 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
eae832eb3c9dfbc96218c071c15cb5fe106e80e0
2fc2f6760d6e26a3297e94c58b8f218a2784208b
stackprobe/RamenX
/RamenX/RamenX/ApStageData.cpp
C++
cpp
26,659
permissive
#include "Stdinc.h" void ApLoadStage_01(void) { initrnd(1); // ---- Wall ---- GmDc.WallPicResnoList->AddElement(P_FIELDWALL_01); // ---- Player ---- GmDc.PlayerStartX = 400.0; GmDc.PlayerStartLeftMode = 0; // ---- Enemy ---- // 0, 500 GmDc.EnemyList->AddElement(MakeAlice(100.0, -1500.0, 0)); GmDc.Enem...
18dd7029c8c07cd99876ec3d5a874d25de3d6431
0cb1eb28fbdbfd0ee2f14e3d1189cba19d874478
PaulMcHard/oldCPP
/Average.cpp
C++
cpp
503
no_license
// Okay lets try this again, here's a code which will average the sum of two numbers #include<iostream> using namespace std; int main() { double num1 = 0; double num2 = 0; double total = 0; double avg = 0; cout << "Please enter a number :"; cin >> num1; cout << "Please enter another number: "; cin >> num2; ...
125d6f274de608417a663be8c0e9fe812e4faf29
8462e9968ac48217de34a314ca924cf2b645d54f
gqxiaofang/ROS
/lidar_driver/pepperl_fuchs_r2000/src/driver/scan_data_receiver.cpp
C++
cpp
12,300
no_license
// Copyright (c) 2014, Pepperl+Fuchs GmbH, Mannheim // Copyright (c) 2014, Denis Dillenberger // All rights reserved. // // Use, modification, and distribution is subject to the // 3-clause BSD license ("Revised BSD License", // "New BSD License", or "Modified BSD License") // You should have received a copy of this li...
05d9f6037e2f1217c193a2cec545afdcb0738a6e
12e9c351428e5ba2cd2fc06afa20e1bc36c85bc7
hipa211a/NPB-CPP
/NPB-FF/EP/ep.cpp
C++
cpp
10,075
permissive
/* MIT License Copyright (c) 2021 Parallel Applications Modelling Group - GMAP GMAP website: https://gmap.pucrs.br Pontifical Catholic University of Rio Grande do Sul (PUCRS) Av. Ipiranga, 6681, Porto Alegre - Brazil, 90619-900 Permission is hereby granted, free of charge, to any person obtaining a copy of this...
058c2ab5d830216c292fae0b3a4c87c2838d5fbd
f5a286b539c56cc67b2ab2f9d63174fd5bd3472b
TrellixVulnTeam/Chromium_7C66
/components/json_schema/json_schema_validator.cc
C++
cc
31,743
permissive
// Copyright 2013 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 "components/json_schema/json_schema_validator.h" #include <stddef.h> #include <algorithm> #include <cfloat> #include <cmath> #includ...
5dfbbfeee8b9d0047e2f13a4bf43561d5275a318
f4506edaba53b41f21ec86db9284a8846bf6214f
pradeepcredenceid/tabasco_frameworks_av
/media/libmedia/IHDCP.cpp
C++
cpp
9,969
permissive
/* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
91cc19c5548509246831ac702e05b0e9648af71b
d565072b12d3967572eff83ac62e9f23d78f7b28
bgyss/cppmm
/test/openexr/bind/imf_previewimage.cpp
C++
cpp
1,516
no_license
#include <OpenEXR/ImfPreviewImage.h> #include <cppmm_bind.hpp> namespace cppmm_bind { namespace OPENEXR_IMF_INTERNAL_NAMESPACE { namespace Imf = ::OPENEXR_IMF_INTERNAL_NAMESPACE; struct PreviewRgba { using BoundType = Imf::PreviewRgba; PreviewRgba(unsigned char r = 0, unsigned char g = 0, unsigned char b ...
35a10467401451883b12674ff6374faf68dc277f
d2463f5a7e1f73cc2ae0200be3fc322506271efe
lgsvl/apollo-5.0
/modules/drivers/canbus/can_client/can_client_factory.cc
C++
cc
2,459
permissive
/****************************************************************************** * Copyright 2017 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ...
3910220489f39bca9aad89a397d949f147012b39
005f4b6dd078f5aecbab035fc5e142091e15a2b4
chromium/chromium
/ui/base/window_open_disposition_utils.cc
C++
cc
1,514
permissive
// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/base/window_open_disposition_utils.h" #include "build/build_config.h" #include "ui/events/event_constants.h" namespace ui { WindowOpenDisposition DispositionFro...
7a06aab048f43efa8d3e867ceb21a1b3c8707d5c
c6e49dc00d643c920e4b654c54a3328ed0a27418
ImanolGo/Hearing-View
/src/Events/GuiManager.cpp
C++
cpp
14,445
no_license
// // GuiManager.cpp // HearingView // // Created by Imanolgo on 23/09/12. // #include "Event.h" #include "EventManager.h" #include "AppManager.h" #include "ofxUI.h" #include "DateManager.h" #include "ViewManager.h" #include "Visuals.h" #include "GuiManager.h" GuiManager::GuiManager(): m_gui(NULL),m_eventManager(...
ccf8abe4959ac6f765e73cd9cee21d966d575c2d
6ac4428cd0ba1a8db5f21e52326b2eb56bfabc7e
cleveryuan777/C-background-development-interview-experience
/01.计算机基础知识/05.设计模式/04.行为型模式/02.命令模式/c++/CommandPatternDemo.cpp
C++
cpp
463
no_license
#include <iostream> #include "Stock.h" #include "Broker.h" #include "BuyStock.h" #include "SellStock.h" using namespace std; int main(void) { shared_ptr<Stock> abcStock(new Stock()); shared_ptr<BuyStock> buyStockOrder(new BuyStock(abcStock)); shared_ptr<SellStock> sellStockOrder(new SellStock(abcStock)); shared_...
efd7de15a3d7edd3cdce28c15d037a0b1eee7e8d
5e7ed21e21b960cb1b527219c57f0007a13f46d0
amulyagaur/SPOJ--Awesome-OJ
/LASTDIG.cpp
C++
cpp
340
no_license
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; for(int z=1;z<=t;z++) { long long a,b,p; cin>>a>>b; if(b%4==0 && b!=0) p = pow(a%10,4); else p=pow(a%10,b%4); cout<<p%10<<endl; ...
288cb0eab1f12eb385f18258c62f6a5b509aebdd
9bb87afb32c8570714551d48c7885ad7d40dd103
rakosi2/ESP32Tests
/ESP32_Stepper/src/main.cpp
C++
cpp
944
permissive
#include <Arduino.h> #include <ESPStepperMotorServer.h> ESPStepperMotorServer *stepperMotorServer; const char *wifiName= "<don't commit to github>"; // enter the SSID of the wifi network to connect to const char *wifiSecret = "<don't commit to github>"; // enter the password of the the existing wifi network here voi...
1a549a65e22f9483c6ceae398daa18fd38b1c57e
d0d9113626f8be82439a05c16a88f3c1045e23f9
qhcjfdudn/algorithm_study
/algorithm/BFS/baek_1525_퍼즐.cpp
C++
cpp
1,805
no_license
/* https://www.acmicpc.net/problem/1525 */ /* 퍼즐을 맞춤으로 만들어지는 모양이 불가능한 경우가 있는데, 우선 이 녀석이 안 만들어진다는 걸 어떻게 파악해야 할지.. map을 쓰면 애매하지만, 가장 구현이 간단한 map으로 우선 구현해보았다. 1초 내에 풀이는 되었지만, 분명 더 빨리 풀 방법이 있다. ex) 휴리스틱을 적용? 해쉬? 트라이? 다 도전해봐야겠다. */ #include <iostream> #include <map> #include <string> #include <queue> using namespace...
72ba56ec3b8020e5b60aa4ca87f5ed21773f269b
a51662ddd7850af630b604947e857cb56c9457bf
octoblu/alljoyn
/alljoyn/alljoyn_js/jni/ScriptableObject.cc
C++
cc
6,107
permissive
/* * Copyright (c) 2011-2013, AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWA...
68797a9275ab6c70961cdb1077d3af162969e780
dbd0620d3e601f37a9f304f3ad1e52c8e8d6174b
virtyaluk/leetcode
/problems/266/solution.cpp
C++
cpp
316
no_license
class Solution { public: bool canPermutePalindrome(string s) { int ans = 0; unordered_map<char, int> m; for (char& ch: s) { m[ch]++; } for (auto [_, freq]: m) { ans += freq % 2; } return ans <= 1; } };
dca2023d051a747de4c326376cddd8a7f4937f26
bae771557a2658880e421f43b36cab6e86620432
tensorflow/tensorflow
/tensorflow/core/ops/sparse_csr_matrix_ops_test.cc
C++
cc
16,226
permissive
/* Copyright 2019 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...
3e3aa90261daee2c40ecb815ee4b7621d0ebb168
fd5993799be08ffbfef6c163532eb189a90b571c
DeepWolf413/additional-native-data
/gta5/0xBF4F34A85CA2970C.cpp
C++
cpp
478
no_license
// fm_mission_controller_2020.ysc @ L482425 void func_8295() { char* sVar0; if (!func_200()) { if (func_8296()) { if (MISC::IS_BIT_SET(bLocal_36022, false)) { HUD::_0xBF4F34A85CA2970C(); } else if (Global_1669168) { if (!MISC::IS_STRING_NULL_OR_EMPTY(sVar0)...
33572d2b973f4647bea258780a8d4862eac4f4d5
667110404bc19bca0cb57ecf7837f5b4262ae5fd
drobotunyulia/Lab_1_task_8
/token.cpp
C++
cpp
24,668
no_license
#include "token.h" int get_token_type(string token) { int token_type = UNKNOWN_TOKEN; regex pattern_identifier("[a-zA-Z_][a-zA-Z0-9_]{0,31}"); regex pattern_value("[-]{0,1}[0-9]+"); if (regex_match(token, pattern_identifier)) { token_type = IDENTIFIER; } else if (regex_ma...
3412092aa04e474947546c3169e64579473e60b1
f402db0357ba8c7e8c1b05e279b8e63a17a5f4e5
eliavb/all_distance_sketch
/src/algorithms/ut/t_skim_test.cpp
C++
cpp
23,647
permissive
#include "../t_skim.h" #include "../t_skim_reverse_rank.h" #include "../../graph/snap_graph_adaptor.h" #include <algorithm> namespace all_distance_sketch { // EXAMPLE: With a test fixture and TEST_Fs // A test fixture is used because {TODO(eliav): put reason here}. class TSkimTest : public ::testing::Test { protecte...
83703d85b9c321c7125bbe82dc504a95a1890002
28a57a503e7afae56e22419fb6b70d055a668def
someoneAlready/poj
/_6.Math/3318.cpp
C++
cpp
1,205
no_license
#include <iostream> #include <algorithm> #include <queue> #include <stack> #include <vector> #include <cstdio> #include <cstdlib> #include <cstring> #include <climits> #include <cmath> #include <ctime> #include <cctype> using namespace std; typedef long long ll; #define rep(i, n) for (int i=0; i<(n)...
ec5ebfc20c1abe5782c97202a84f106da89a1c9e
7d11ba553389b46f0d44b409611e84256467bb38
ktp-forked-repos/algorithms-8
/trees/binary_search_tree/implementation/bst/include/t_node.hpp
C++
hpp
694
no_license
// // t_node.hpp // algorithms. BST implementation. // // Created by alifar on 12/1/16. // Copyright © 2016 alifar. All rights reserved. // #include <iostream> template <class N> struct Tnode{ N data; int height; // height of node is used in AVL implementation Tnode *left; Tnode *right; Tnode *parent; ...
c97ae5151be8e0e1b4897b14d3856a52eebd35fa
4aba836efd60e0508df9388e069ddb51876be231
DolaBMOon/CodeerStf
/XJOI/1001/F/t.cpp
C++
cpp
566
no_license
#include<cstdio> #include<cstring> #include<cassert> #include<iostream> #include<algorithm> using namespace std; #define Whats(x) cout<<#x<<" is "<<(x)<<endl #define DivHim() cout<<">>>>>>>>>>>>>>>"<<endl #define DivHer() cout<<"<<<<<<<<<<<<<<<"<<endl #define Oops() cout<<"!!!!!!!!!!!!!!!"<<endl template<typename T>...
316e9dce437acf765c2ada55c846fae2206f82d8
fe7c5e1a4e18bf53eb50b7cb3bd66c193cdd864d
davidlove/omrp
/regularized_decomposition/src/periods.cpp
C++
cpp
10,661
no_license
/*------------------------------------------------------------------------------ MODULE TYPE: File input routine. PROJECT CODE: REGULARIXED DECOMPOSITION PROJECT FULL NAME: Implementation of the regularized decomposition for two stage linear programs. MODULE AUTHOR: Artur Swietanowski. PROJECT SUPERVISOR: pro...
9ebdd314d7d8436014f7e07b5a37a88c3003fb1b
c1efe380434b14808e219c8ba685b1f5a480314c
vadimibs/rabota3
/stol.cpp
C++
cpp
444
no_license
#include "stol.h" stol::stol(string name_, int size_, string color_, string material_):mebel(name_, size_, color_, material_){ } stol::stol(const stol &p){ name = p.name; size = p.size; color = p.color; material = p.material; } void stol::print() const{ cout << "Nazvanie: " << name << en...
90b3ad70e5643320500dd1184d1e6cf1e19a4dbd
f993db2c14489e3b1d23b4bde6d8f052b35c4f2f
AkashBabu/hermes
/lib/Regex/RegexParser.cpp
C++
cpp
27,068
permissive
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the LICENSE * file in the root directory of this source tree. */ #include "hermes/Regex/Compiler.h" #include "hermes/Regex/RegexTraits.h" namespace hermes { namespace regex { using llvm::Optional;...
6425076368ac9159281c7620a4046c12d5110f77
244677675ebc69d05270d924d429e63abe2bfe3a
Harshacse/Competitive-Coding
/LIBRARY/Segment Tree/sum_in_range.cpp
C++
cpp
2,591
no_license
#include <iostream> using namespace std; #include <math.h> //SEGMENT TREE BEGINS class SegmentTree { public: int *st,*arr,n; int getMid(int s, int e) { return s + (e -s)/2; } int getSumUtil(int ss, int se, int qs, int qe, int si); void update_query(int ss, int se, int i, int diff...
670b8e990d70680cb7240740cc90db3cc39db80d
43b48d55adb650b4ee52126b90432ece07195046
anoushkanandan/dsa450
/Array/union_intersection.cpp
C++
cpp
1,314
no_license
// C++ program to find union of // two sorted arrays #include <bits/stdc++.h> using namespace std; /* Function prints union of arr1[] and arr2[] m is the number of elements in arr1[] n is the number of elements in arr2[] */ int printUnion(int arr1[], int arr2[], int m, int n) { int i = 0, j = 0; while (i < m && j < ...
8bbccc91e53dc0e7b64cb18674957e65e0a4d993
b77d212ad03a63e3f8f81f29aded78a90cc76efd
Egg-Cup/lvm
/libraries/glua/glua_compile_op.cpp
C++
cpp
6,764
permissive
#include "base/common_api.hpp" #include "base/exceptions.hpp" #include "glua/glua_complie_op.h" #include "glua/glua_lutil.h" #include<fc/exception/exception.hpp> #include<fc/string.hpp> #include<boost/uuid/sha1.hpp> #include<string> CompileOp::CompileOp() { } CompileOp::~CompileOp() { } fc::path...
dbdb9566573fb536c3c35ecabe95ec9a1d91a357
8263255f1a467f3c123cc9db015dcd964fe0548e
shivani201/lab2
/lab3.q1.cpp
C++
cpp
666
no_license
// include library # include <iosream> using namespace std; //main function int main() { int sizeint; // declaration sizeint = sizeof (int); // initialization cout << "The size of integer is " << sizeint << endl; // prints on terminal int sizefloat; sizefloat = sizeof (float); cout << "The size of float is " << sizeflo...
8a0ba10971fd4e09945d0520b2e2b7193f106120
8cfb02c6d57039e8cb225d5bfb0e6976c0d0555c
sjr213/fractalx
/FractalX/DxColors/PinTracker.cpp
C++
cpp
7,774
no_license
#include "stdafx.h" #include "PinTracker.h" #include <algorithm> #include <assert.h> #include "DxColorUtilities.h" #include <optional> using namespace std; namespace DxColor { CPinTracker::CPinTracker(CSize screenSize, int numberOfColors, int iconDimension, const vector<ColorPin>& pins, CPoint topLeft) : m_screen...
b0dd410b5716ceaf173cb40e7fb06d5838f844c7
ddb5505334835aa3f2c9deeb61c8334d9c5c69eb
chinachina1/myluagame
/MyLuaGame/frameworks/cocos2d-x/cocos/renderer/CCTexture2D.cpp
C++
cpp
47,616
no_license
/**************************************************************************** Copyright (c) 2008 Apple Inc. All Rights Reserved. Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a...
3570bb4ef61a8bfc779fff936f1fdd9a08fd7c11
223d0fff19ddb72e38e0ab1cf2f326abac13d864
restjohn/geotrans
/SpreadsheetTester/src/MSPCCS_SpreadsheetTester.cpp
C++
cpp
1,137
no_license
// CLASSIFICATION: UNCLASSIFIED // MSPCCS_SpreadsheetTester.cpp : Defines the entry point for the console application. // #include "ctype.h" #include <stdlib.h> #include <string.h> #include <iostream> #include "SpreadsheetTester.h" #include "CoordinateConversionException.h" using namespace std; int main(int argc, ...
462c7ac94d960a46379f730629f5fcf12ed406ff
c617ee65d62ea765b3c599050daa6a3040c3b4ca
stevenchen1976/myChatIce
/Server.cpp
C++
cpp
1,157
no_license
#include <Ice/Ice.h> #include <Chat.h> #include "Impl/ServerImpl.h" #include "Impl/RoomImpl.h" #include "Impl/UserImpl.h" using namespace std; using namespace Chat; int main(int argc, char* argv[]){ int status = 0; Ice::CommunicatorPtr ic; try { ic = Ice::initialize(argc, argv); Ice::Obj...
df41789c1bb7bae3b0884cf8cafbb0ae1ae3b9cb
1afbe8b84ec4e6a775456d9add3f515f0ef797e7
mirek190/x86-android-5.0
/external/pdfium/fpdfsdk/src/formfiller/FFL_PushButton.cpp
C++
cpp
1,269
permissive
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FormFiller.h" #include "../../inclu...
5b7fe07dccd998c240017eb5e283fa6d12f869e3
708f7a5390aab116d47d063b38545b9623547b79
EatThePath/fs2open.github.com
/code/particle/particle.cpp
C++
cpp
13,970
permissive
/* * Copyright (C) Volition, Inc. 1999. All rights reserved. * * All source code herein is the property of Volition, Inc. You may not sell * or otherwise commercially exploit the source or things you created based on the * source. * */ #include "bmpman/bmpman.h" #include "particle/particle.h" #include "part...
03474a91dd21cbc67b3357888e55316b737d91bb
b5ff872b9b1753338fb6bec59fb547670745aa15
Kotaeru/CIS22C_Database_Project
/Song.cpp
C++
cpp
2,814
no_license
/* * Song.cpp * * Created on: Nov 22, 2017 * Author: Maya */ #include "Song.h" #include <iostream> #include <iomanip> #include<string> #include<sstream> using namespace std; //Song::Song():songName(""), songAlbum(""), songDate.month=0, songDate.day=0,songDate.year=0, lyrics(""), onChart(fal...
cf0e2a2a2a7afd0d722b7ebbd2f9cd61f002f927
073327ffb5893409387ece1f829d16bdd46ab813
strigazi/athena
/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.cxx
C++
cxx
2,003
permissive
/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "G4AtlasSvc.h" #include "GaudiKernel/ServiceHandle.h" // header files from Geant4 #include "G4VUserPhysicsList.hh" #include "G4VModularPhysicsList.hh" #include "G4ParallelWorldPhysics.hh" #include "G4RunManager.hh" G4AtlasSvc::G...
c41cc73d6909bc95de16daee14cb9fa6e2ad6b05
4892b3d9b53aad1a02b7e3d7bd434269f0ed4832
pusparajm/whatsapp-purple
/wa_purple.cc
C++
cc
54,336
no_license
/** * purple * * Purple is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this * source distribution. * * Whatsapp is a free implementation of the WhatsApp protocol for libpurple. * The implementation is not 100% complete. ...
38b03d087ab2d6d828c732eb4008516a9007bbcb
05da67e673d3da636924d159ec64bf41382bb1a1
Foxconn-bmc-tpa/phosphor-host-ipmid
/apphandler.cpp
C++
cpp
23,303
permissive
#include "apphandler.h" #include "app/channel.hpp" #include "app/watchdog.hpp" #include "host-ipmid/ipmid-api.h" #include "ipmid.hpp" #include "nlohmann/json.hpp" #include "types.hpp" #include "utils.hpp" #if __has_include(<filesystem>) #include <filesystem> #elif __has_include(<experimental/filesystem>) #include <exp...
c5b597bc41846bceac82e55da11226eab9131a2a
84e6e54f78982fb3f77d1fbc407494dbc7cb7872
BorelSigma/thrill
/thrill/api/all_gather.hpp
C++
hpp
3,692
permissive
/******************************************************************************* * thrill/api/all_gather.hpp * * Part of Project Thrill - http://project-thrill.org * * Copyright (C) 2015 Alexander Noe <aleexnoe@gmail.com> * Copyright (C) 2015 Sebastian Lamm <seba.lamm@gmail.com> * * All rights reserved. Publish...
9fcf2bd9e45f4e7ee807e1954b09d84bdbe5f70f
0154acf0272d0ee5da169348188d27da39e31879
liutuoni/chromium
/sandbox/policy/features.cc
C++
cc
3,037
permissive
// Copyright 2017 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 "sandbox/policy/features.h" #include "base/win/windows_version.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" namesp...
7770ab7f0bd65221892f49788059403690abb2a5
b9125efddfc116f69f943c5b9e354f534660559f
xtblock/chromium
/third_party/blink/renderer/core/app_history/app_history_entry.cc
C++
cc
1,867
permissive
// Copyright 2021 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/core/app_history/app_history_entry.h" #include "third_party/blink/renderer/core/app_history/app_history.h" #include ...
97e77b3f8379684de469d53fb6f4926b63a14463
a789f3819be781a82c807b37a5f95258d7885534
intergrals/CS488
/A5/GeometryNode.hpp
C++
hpp
635
no_license
// Fall 2018 #pragma once #include "SceneNode.hpp" #include "Primitive.hpp" #include "Material.hpp" class GeometryNode : public SceneNode { public: GeometryNode( const std::string & name, Primitive *prim, Material *mat = nullptr ); bool metallic = false; double reflectiveness = 0; double refractivene...
86c19e9a0c52b305a954c1736190220d9c0539f6
82fdd51a3ce931013817fd406525d1338762dee8
xlwh/study
/linuxc/demo25.cpp
C++
cpp
588
no_license
#include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char **argv) { pid_t pid = fork(); int status; if(pid < 0) { printf("fork error\n"); } else if(pid > 0) { printf("parent process\n"); pid_t pr = wait(&statu...
be2c13b314cc82fd3f4c7299908f5f25556e5b51
73b08b5abe963e52b85918317cf6f1ff4b61ba86
metux/chromium-suckless
/chrome/browser/apps/drive/drive_app_mapping.cc
C++
cc
5,637
permissive
// Copyright 2014 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 "chrome/browser/apps/drive/drive_app_mapping.h" #include <stddef.h> #include "base/values.h" #include "chrome/common/pref_names.h" #include "co...
627f07be599df27b7601d7d6fe4f6812706fb053
94818bcf473cdce4ebe673f19c870ea145b2db85
caniouff/TexGraph
/Source/SprueEngine/Geometry/MeshOctree.cpp
C++
cpp
13,985
permissive
#include "MeshOctree.h" #include <SprueEngine/Math/MathDef.h> #include <SprueEngine/Math/Triangle.h> #include <SprueEngine/MathGeoLib/Geometry/LineSegment.h> namespace SprueEngine { #define BOTTOM_LEFT_FRONT 0 #define BOTTOM_LEFT_BACK 1 #define BOTTOM_RIGHT_FRONT 2 #define BOTTOM_RIGHT_BACK 3 #define TO...
eb29267e56e16a8f9488d1c3c422d805c549901e
adcbf2c98030f282fc8a5514dc6aa93ad2ba1f53
mcnevesinf/p4box
/ir/dbprint-expression.cpp
C++
cpp
8,890
permissive
/* Copyright 2013-present Barefoot Networks, 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 agreed to in ...
faf7e44aa0c3518ffe642d2d1bc298868e21f049
217c3d7435ea4c1b67c5c503c0d8018ef226d3b8
theopolis/osquery
/plugins/logger/tls_logger.cpp
C++
cpp
3,739
permissive
/** * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed in accordance with the terms specified in * the LICENSE file found in the root directory of this source tree. */ // clang-format off // Keep it on top of all other includes to fix double include WinSock.h...
d075b51d0544df5a4a1b1761f909fba13bc22168
3bf9ad3d446f11d476dfff311fa86fa152827bdf
ersanliqiao/mlpack
/src/mlpack/methods/amf/init_rules/random_acol_init.hpp
C++
hpp
2,287
permissive
/** * @file random_acol_init.hpp * @author Mohan Rajendran * * Intialization rule for Alternating Matrix Factorization. */ #ifndef __MLPACK_METHODS_LMF_RANDOM_ACOL_INIT_HPP #define __MLPACK_METHODS_LMF_RANDOM_ACOL_INIT_HPP #include <mlpack/core.hpp> namespace mlpack { namespace amf { /** * This class initializ...
ec3c8fd35e213ae3f3373ba2fb7150afa345b8d4
612bb144cef2e9416108bf4ca18ecf1a2cb0386d
hiroshi-maybe/atcoder
/solutions/LongCommonSubsequence.cpp
C++
cpp
2,896
no_license
#include <bits/stdc++.h> using namespace std; // type alias typedef long long LL; typedef pair<int,int> II; typedef tuple<int,int,int> III; typedef vector<int> VI; typedef vector<string> VS; typedef unordered_map<int,int> MAPII; typedef unordered_set<int> SETI; template<class T> using VV=vector<vector<T>>; // minmax te...
263577c7f8148dd12ad3da744b352b88d1913a96
745788fbea610a0350b1b2747884a028c7bf9baa
Jasikainen/ohj3-nysse
/Game/city.hh
C++
hh
2,077
no_license
#ifndef CITY_HH #define CITY_HH #include "gamemainwindow.hh" #include <interfaces/icity.hh> /** * @file * @brief Defines a class that implements City for Game */ namespace Game { class City : public Interface::ICity { public: City(); ~City(); // ICity interface public: void setBackground(QIm...
5d18937981196dcde51beb37895fb1a375ad5b0c
4cb0cef23ac2c2f143ea55646b98261ce4463f6f
seafrog1984/ColorDetect
/ColorDetect/ColorDetect/main.cpp
C++
cpp
267
no_license
#include "ColorDetect.h" #include <QtWidgets/QApplication> #include "LogDlg.h" int main(int argc, char *argv[]) { QApplication::addLibraryPath("D:\\ColorConfig\\plugins"); QApplication a(argc, argv); LogDlg w; //ColorDetect w; w.show(); return a.exec(); }
91a98eab7c68d140933286104daae5f8447fd875
7bc25da816229b094275fd1e42212a32027c851d
RyanSwann1/Snake---Uni-Work
/src/Managers/SystemManager.cpp
C++
cpp
2,392
no_license
#include <Managers\SystemManager.h> #include <Systems\SystemDrawable.h> #include <Systems\SystemSnake.h> #include <Systems\SystemPlayerController.h> #include <Systems\SystemMovable.h> //System Manager SystemManager::SystemFactory::SystemFactory(SystemManager& systemManager) { registerSystem<SystemDrawable>(systemMana...
cbc63305ad851984652ec8797d349ce38caf2bf3
47f99b81507ca0b69e270801b27db9c1f4060984
tonycao/CodeSnippets
/C-CPP/Leetcode/word-search.cpp
C++
cpp
1,511
no_license
#include <iostream> #include <vector> using namespace std; class Solution { public: bool exist(vector<vector<char> > &board, string word) { // DFS: Time ~ O(M^2*N^2), Space ~ O(M*N) // Time: DFS ~ O(MN = number of edges), loop ~ O(MN) int m = board.size(); int n = board[0].size(); ...
f3b5f01fc493b616fc24521f5795db6794c9dc54
65f9ed27ab7e2edb5bc47bb8b5ad2457bfa64e39
NaturalCoder/graphene
/tests/tests/authority_tests.cpp
C++
cpp
42,499
no_license
/* * Copyright (c) 2015, Cryptonomex, Inc. * All rights reserved. * * This source code is provided for evaluation in private test networks only, until September 8, 2015. After this date, this license expires and * the code may not be used, modified or distributed for any purpose. Redistribution and use in source a...
4651f41ab48b3e41d308d588a42b51a20743e487
9196c6c43acdff40d2b56cb0712acb8720f585be
zanzo420/SoT-Python-Offset-Finder
/SDK/ADS_CapstanNative_functions.cpp
C++
cpp
479
no_license
// Name: SoT, Version: 2.2.1.1 #include "../pch.h" /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Functions //----------------------------------------------------...
bca9e00a6c48dde37af854fb453cbce22cf6b7b8
502a49bd9bf1530a9eeee7703de15c8c241ff6f7
S-Dutta1/cirkit
/addons/cirkit-addon-reversible/src/reversible/generators/reciprocal.hpp
C++
hpp
1,491
no_license
/* CirKit: A circuit toolkit * Copyright (C) 2009-2015 University of Bremen * Copyright (C) 2015-2016 EPFL * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
cda73722118dc11ce7375f18dd40ade9cdff2f06
2ba9af2a3edfaacd13e3ed6253cd06e0d8a9724f
valmac/aeron
/aeron-archive/src/main/cpp/client/AeronArchive.cpp
C++
cpp
7,522
permissive
/* * Copyright 2014-2020 Real Logic 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
ce8765b7fb8d8f6dd77f2e6b579c59aa2841f75b
a711378c731ae69e73b4ca10bdad311093313f5a
DuPengFei-du/Arithmetic--Learning
/不修改数组找出重复元素/不修改数组找出重复元素/main.cpp
C++
cpp
2,824
no_license
/* 题目:在一个长度为n+1的数组里的所有数字都在1~n的范围内,所以数组至少有一个数字是重复的 请找出数组中任意一个重复的数字,但不能修改输入的数组。 例如 如果输入长度为8的数组{2,3,5,4,3,2,6,7},那么对应的输出是重复的数字2或者3。 */ /* 方法一:因为不能改变输入的数组,我们可以定义一个长度为n+1的辅助数组 然后根据数组下标逐一把输入的数组的元素赋值到辅数组,这样很容易能发现那哪个数组是重复的。 但该方法需要O(n)的辅助空间。 */ /* 函数功能:判断数组中是否含有重复数字 参数: numbers:数组名, length:数组长度 value:重复的数字 返回值:...
381d43ac15d18c3add25ed84e4ae37612addcae3
5694d8d898acc55cddf99148514deae6458e3b07
alexandraback/datacollection
/solutions_5630113748090880_0/C++/w93163red/Round_1A_B.cpp
C++
cpp
1,043
no_license
// Round_1A_B.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <unordered_map> #include <iostream> #include <vector> #include <algorithm> #include <fstream> using namespace std; int main() { int t; int nn; ifstream ifile; ifile.open("B-small-attempt2.in");...
ae564583c9d90486084be70b4ecc76c571372803
74c2fce250b99e7847a083468538060300c98988
KDuyVu/Problems
/delivery (3)/statement/delivery.cpp
C++
cpp
1,909
no_license
// A.Astrelin - Delivery #include <stdio.h> int main(){ freopen("delivery.inp", "rt", stdin); freopen("delivery.out", "wt", stdout); int M,N,b,c,d; scanf("%d%d%d%d%d",&M,&N,&b,&c,&d); char s[10]; scanf("%s",s); char myor=s[0]; int a=1; switch(myor){ case 'B': if(c<=3) goto _wa...
6f2aec099cbda0c896ca7644857964c5a008e74e
a36a4d90077ab9f5d5ea9956f1d3cdf9c653f7d8
nbailey/amod-abm
/osrm-backend-5.11.0/third_party/libosmium/include/osmium/version.hpp
C++
hpp
1,715
permissive
#ifndef OSMIUM_VERSION_HPP #define OSMIUM_VERSION_HPP /* This file is part of Osmium (http://osmcode.org/libosmium). Copyright 2013-2017 Jochen Topf <jochen@topf.org> and others (see README). Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or org...
54fa9a9c94a4e3a39e9a291d15ca4cd2b27d1c19
cde9e90cfb15e75ce14924319a8b76cb7ecb50bc
JiangJinpeng/sofa-pbrpc
/unit-test/test_epoll_support.cc
C++
cc
843
permissive
// Copyright (c) 2014 Baidu.com, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Author: qinzuoyan01@baidu.com (Qin Zuoyan) #include <sofa/pbrpc/io_service.h> #include <gtest/gtest.h> class EpollSupportTest: public ::testing::Test...
f7935b3d117c27ededf9d4c920a8915d17ee2690
3daa014be73d9763044d8a4afbb216efce37ef2b
srimani-programmer/Programming
/CPP/Basics/CorrectnessAndLoopInvarient.cpp
C++
cpp
420
no_license
#include<iostream> using namespace std; int main(){ int a[1000],n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ for(int j=n-1;j>0;j--){ if(a[j]<a[j-1]){ int temp = a[j]; a[j] = a[j-1]; a[j-1] = temp; ...
849f94c111d3e0329d6c6f972e300ad543cd09bb
5db1e47c99c7c4d4a42a81ebcada2f3603857e81
FergusGreig/EulerProj
/Euler/ten/manyprime.cpp
C++
cpp
480
no_license
#include<iostream> using namespace std; int main(){ int primes[10001]; int i,x,n; for(i=0;i<10001;i++){ primes[i]=0; } i=2; primes[0]=2; primes[1] =3; x=4; while (i<10001){ n=0; while (primes[n]!=0){ if (x%primes[n]==0)break; n++;...
a472350c43170f9a068e1097e168b9d100302f45
1fa4472c8ac3f297e1e285a6fc682910911524de
Mori-Levinzon/CAD-Inspector
/Final Hololens App/Il2CppOutputProject/Source/il2cppOutput/System.Runtime.cpp
C++
cpp
782
no_license
#include "pch-cpp.hpp" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <limits> #include <stdint.h> IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored ...
e05c9cf4a3eef4218ab283324d11b557f0db3d7b
a87cc55e0d44069eee18f8c3edeb0609e1e391fb
CitrusForks/unrimp
/Renderer/RendererRuntime/src/Resource/Material/MaterialTechnique.cpp
C++
cpp
11,896
permissive
/*********************************************************\ * Copyright (c) 2012-2017 The Unrimp Team * * 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 wit...
fd5ba422fadcf3cfb50ef7b403f723930c6cbde3
141bf79194dbf384b18ee9355a41ea14d6a968ec
markjcasas/CPSC121
/copy/Labs/Lab_04/prob01/test/unittest.cpp
C++
cpp
1,275
permissive
#include <gtest/gtest.h> #include <gmock/gmock.h> #include "gtest_ext.h" using ::testing::HasSubstr; using ::testing::MatchesRegex; using ::testing::ContainsRegex; TEST(UserInput, AskMonthlySales) { std::string user_input = "300.25\n400.75\n350.21\n601.28\n702.45\n265.45\n365.89\n291.18\n500.37\n333.68\n450.92\n600...
e597e1fdbb28f25f06380937cf637c16ecaa3330
9aa4108cf9223f5f62a273f26551b419d48040c8
keerthna-manikandan/dsa-arrays
/level2/row_with_max_1.cpp
C++
cpp
418
no_license
#include <bits/stdc++.h> using namespace std; int main() { int n; cout<<"Size: "; cin>>n; int max=0,maxi,count=0,x; for(int i=0;i<n;i++) { count=0; for(int j=0;j<n;j++) { cin>>x; if(x==1) count++; } if(max<count) { ...
9aa82e792b8bcfd3b392bfd7010c7386616b8d01
caa9b57fe227e36be1d8f03cdf5ffba0de02e55c
IAmAnubhavSaini/cryptoAlgorithm-nt5src
/Source/XPSP1/NT/inetcore/outlookexpress/mailnews/news/newsstor.cpp
C++
cpp
90,046
no_license
/* * n e w s s t o r . c p p * * Purpose: * Derives from IMessageServer to implement news specific store communication * * Owner: * cevans. * * History: * May '98: Created * June '98 Rewrote * * Copyright (C) Microsoft Corp. 1998. */ #include "pch.hxx" #include...
c5e2495cc21200d4188e42f52850496b3cd3d156
90d69d07acab3eb577ea60c83c4119980204e545
theanonym/libyoba-perl
/src/callbacks.cpp
C++
cpp
2,806
permissive
#include "yobaperl/callbacks.hpp" #include "yobaperl/perl.hpp" #include "yobaperl/perl_exception.hpp" namespace yoba { namespace priv { Callbacks::Callbacks(Perl & perl) : _perl(perl) { } Callbacks::Callbacks(const Callbacks & to_copy) : _perl(to_copy._perl), _callbacks_void_to_void(to_copy._callbacks_v...
e35825d209357ed28225d145aa4e00991b2fd9dc
b22422a1c57c5d21905f3302751fa9e835e55f8e
Min-field/blog-article
/note/面试笔试题/找到第一个重复字符.cpp
C++
cpp
302
no_license
class FirstRepeat { public: char findFirstRepeat(string A, int n) { set<char> s; for(int i = 0; i < n; i++) { if(s.find(A[i]) == s.end()) s.insert(A[i]); else { return A[i]; } } return 0; } };
dddf4c728d235dfd230218c67d1c73cf763dcd42
b383e58e052f84a159306d12358639fea02d192e
yeqfx/windowsprogramming_ksy
/TestCppHandle/TestCppHandle.cpp
C++
cpp
3,079
no_license
// TestCppHandle.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다. // #include "pch.h" #include <iostream> using namespace std; typedef unsigned int HANDLE; struct HandleData { HANDLE h; char* p_string; }; class HandleManager { private: unsigned int m_max_count, m_gen_value; HandleData* mp_d...
b2cc2884e29f86be56f718e97479a9d9ced32d87
ce5e832d5363455f81f78e42701a1f7cb6300e98
MyMiDiII/bmstu-oop
/lab_03/load/builder/scenebuilder.cpp
C++
cpp
345
no_license
#include "scenebuilder.h" void SceneBuilder::build() { _scene = std::make_shared<Scene>(); } void SceneBuilder::buildObject(const std::shared_ptr<Object> &object) { _scene->addObject(object); } bool SceneBuilder::isBuild() const { return nullptr != _scene; } std::shared_ptr<Scene> SceneBuilder::get(...
cfd54f593874b22be2ea3fe669832fde3db362a3
e8d8e33370fe58a346228fd575da108c1469ac89
LakshmiAnuroopaAnala/CPP
/Kadanes_ALGORITHM.cpp
C++
cpp
458
no_license
#include<iostream> using namespace std; void MaxSumSubArray(int n,int *arr) { int global=arr[0]; int current=arr[0]; int c=1; for(int i=1;i<n;i++) { if(current<(current+arr[i])) { current=current+arr[i]; c++; } if(global<current) { global=current; } } cout<<global<<" "<<c;...
c84c174b961449bf199d34f6f0c3d30da8f69bc0
945e949a04f6a2cf9dceba00dabbbb21216178f7
derrickpriyanshu/PROGRAMS
/snakeprocmod.cpp
C++
cpp
940
no_license
#include<bits/stdc++.h> using namespace std; int main() { int l; int k =0; int r; cin>>r; while(r--) { cin>>l; int flag = 0; int counth = 0; int countt = 0; char str2[l]; char str[l]; cin>>str; for(int i=0;i<l;i++) { if(str[i]!='.') { str2[k]=str[i]; k++; } } /*for(int i=0;i<...
77ad719e0e940d0ff8dd3e238ca8ea9466b68f6a
cda41571f7fac892ad12bd5b71565a091a3a751c
ydk1104/ITE2038
/project5/src/buffer.cpp
C++
cpp
4,484
no_license
#include<buffer.h> //private int bufferManager::push(int table_id, pagenum_t pagenum, bool is_read){ int i = stk.pop(); page_t* page = buffer + i; page->lock(); page->table_id = table_id; page->pagenum = pagenum; //empty list if(size++ == 0){ headidx = tailidx = i; page->nextidx = headidx; page->previdx ...
375682d51776288867b337f0dc753e8003a63145
364469951e251c2e217e8e1492458d1db4c4e19a
cutefishos-ubuntu/bluez-qt
/src/obexobjectpush.cpp
C++
cpp
1,627
no_license
/* * BluezQt - Asynchronous Bluez wrapper library * * SPDX-FileCopyrightText: 2014 David Rosca <nowrep@gmail.com> * * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ #include "obexobjectpush.h" #include "pendingcall.h" #include "utils.h" #include "obexobjectpush1.h" n...
f8d8fcdd8a0ee6637ba979cf76cd0cd023bf7992
029db79460154d69ed28feff6b28bae47c16316c
zhandb/tegrenys
/TGIPPCodec/TGCodecManager.cpp
C++
cpp
1,165
no_license
#include "TGCodecManager.h" #include "TGMJPEGDecoder.h" #include "..\TGSystem\tgsystem.h" #include "tgippcodec.h" #include <QtCore\QtPlugin> //--------------------------------------------------------------------------- Q_EXPORT_PLUGIN2(TGIPPCodec, TGCodecManager); //----------------------------------------------...
1a286f1198f676eec32f616c0eb68f197d6c62b2
e4eb70b0fd3a509f9f83aa81e35176b633019b0d
metux/chromium-suckless
/chrome/browser/task_manager/providers/web_contents/extension_tag_browsertest.cc
C++
cc
4,497
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 <algorithm> #include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "chrome/browser/e...
e4c9104c2478f9751eaa677c7c68c968fa86d8f2
614ebdd22ff61c3189fdc91145abb346382f96b7
WindZQ/C_Plus_Plus_Concurrency_in_Action
/Chapter_7_Designing_Lock_free_Concurrent_Data_Structures/7.1.cpp
C++
cpp
317
no_license
#include <atomic> class spinlock_mutex { std::atomic_flag flag; public: spinlock_mutex() : flag(ATOMIC_FLAG_INIT) {} void lock(void) { while(flag.test_and_set(std::memory_order_acquire)); } void unlock(void) { flag.clear(std::memory_order_release); } };
c81be3d93376adc56d3004e69e737a186fa1d46c
c2286ad93c3c8660ccd1863d7a14eb7c799e4ace
hitimr/SimFab
/Ex2/viennals/include/lsMessage.hpp
C++
hpp
1,435
permissive
#ifndef LS_MESSAGE_HPP #define LS_MESSAGE_HPP #include <iostream> /// Singleton class for thread-safe logging. class lsMessage { std::string message; bool error = false; const unsigned tabWidth = 4; lsMessage() {} public: // delete constructors to result in better error messages by compilers lsMessage(...
83e08cb8f9011a4566a6ace373fff4b6b7af46dd
5aebd7cb352fb4fb4b6e1c8219c8263245c13ea6
paozer/piscine_cpp
/mod05/ex00/Bureaucrat.hpp
C++
hpp
711
permissive
#pragma once #ifndef BUREAUCRAT_HPP #define BUREAUCRAT_HPP #include <iostream> #include <exception> class Bureaucrat { public: Bureaucrat(const std::string& name, int grade); Bureaucrat(const Bureaucrat&); Bureaucrat& operator=(const Bureaucrat&); ~Bureaucrat(); Bureaucrat...
dad9979dd27fda2bb4c3c0066452cd9b9fbff685
38041fe493081409490e15a3101b1abf09e0ddb9
Qj9901/QuSim
/applications/QuCalBenchmark/QuCalBenchmark.cpp
C++
cpp
1,403
no_license
#include "../../src/Cal.h" #include <chrono> #include <functional> void test(char const *expr, std::function<CCom(CCom x, CCom y)> const &func) { printf("benchmark for %s\n", expr); int niter = 10000000; { Cal cal(expr); double c = 0; auto t0 = std::chrono::high_resolution_clock::now(); cal.SetVarVal("x"...
ef1147ad9354ff91b5db11d845a6c34ea97cd560
f858d23631c68a687c5d9ee9daa7f79e92cff8bb
EvgenyVRN/VTK
/Common/ExecutionModel/vtkDataObjectAlgorithm.cxx
C++
cxx
5,147
permissive
/*========================================================================= Program: Visualization Toolkit Module: vtkDataObjectAlgorithm.cxx Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This so...
ad0ca33fc4e143854f5d53255474a656ec5e80f3
b033990683511b37177e7fd3839a21dfb6b994d5
MajaGruca/CppClass
/lab8/moviesubtitles/main.cpp
C++
cpp
571
no_license
// // Created by ktr on 04.05.2017. // #include "MovieSubtitles.h" #include <iostream> #include <sstream> using namespace moviesubs; int main() { moviesubs::SubRipSubtitles subs; //stringstream in {"1\n00:05:54,555 --> 00:05:56,722\nText\n\n2\n00:06:06,433 --> 00:06:07,801\nNEWLINE\n"}; std::stringstream i...
a4637dc3762463189c7349ceb5eb636a56acbf02
ac8a3abb5987a6bb5bc948d2f52949c25867b0ae
RichardHladik/DPF
/dgl/ImageWidgets.hpp
C++
hpp
8,247
permissive
/* * DISTRHO Plugin Framework (DPF) * Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com> * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this * permission notice appear in all copies. ...
23b61a2840ebb3f7f91fe331ac561cfe04fa23e9
fd11708184a7c1bc5fea4b27d0076b45bcd48b2a
nqtwilford/Misc
/CppShortCode/Makefile/Console_make/main.cpp
C++
cpp
417
no_license
#include <iostream> using namespace std; int main(int argc, char* argv[]) { cout << "hello world"<<endl; cout << "----------------------------" << endl; cout << "filename=" << __FILE__ << " line="<< __LINE__ << endl; cout << "time="<< __TIME__ << " date="<< __DATE__ << endl; cout << "funn...
6c1d40d3355664e9880fa909f6b8c40b307fd44b
a0c366879c648bde26fce7841a0216ab82c0ced8
shmhlove/CPPIntermediate
/u05_const_member_function/test1.cpp
C++
cpp
799
no_license
/* 빌드 하는 법 g++ test1.cpp cl test1.cpp /nologo /EHsc 주의! VC++ 확장 문법 사용을 사용해야함. /Za 옵션을 사용하면 컴파일 안됨 */ #include <stdio.h> #include <iostream> using namespace std; class Point { public: int x, y; Point(int a = 0, int b = 0) : x(a), y(b) {} void set(int a, int b) { x = a; y = b; } void print() { co...
78638c65f69bf2136662df0149630e452f596130
11c50a4cd7731c88d72a5e92a83357b4af489832
IMCG/lockfree-link-list
/src/fine_grained_list.cpp
C++
cpp
5,769
no_license
#include <stdexcept> #include <iostream> #include "fine_grained_list.h" template<typename K, typename T> FineGrainedNode<K,T>::FineGrainedNode(K k, T v) : Node<K,T>(k, v) { lock = (pthread_mutex_t*) malloc(sizeof(pthread_mutex_t)); pthread_mutex_init(lock, NULL); next = NULL; } template<typename K, typename T> Fi...
6339480afac912b4211c10cfd2497257166885bf
72bfe61c27d21fcff88e9379619378f4be708cc8
gaper94/LoveLetter
/GameServer/Joueur.cpp
C++
cpp
2,859
no_license
#include "Joueur.h" #include <iostream> #include "../GameCommon/GameUtils.h" Joueur::Joueur(const std::string& _name) : name(_name) { } Joueur::~Joueur() { } const std::string& Joueur::GetName() const { return name; } void Joueur::PrintHand() { for(const auto& current : playerDeck) ...
3abfdcfbdf0a04d09da9711294b7c0e029a984be
ba244b1663f0bcaffe199288773f85c15e106ea0
yusuke-matsunaga/druid
/c++-src/sa/minpat/Compactor.cc
C++
cc
13,464
no_license
/// @file Compactor.cc /// @brief Compactor の実装ファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2015 Yusuke Matsunaga /// All rights reserved. #include "Compactor.h" #include "FgMgr.h" #include "ym/HashSet.h" #include "ym/StopWatch.h" BEGIN_NAMESPACE_DRUID_SA BEGIN_NONAMESPACE // グループの要素数の昇順に並べるため...
da1be7e31ccb149c823f09f8c2512b0853b8b50b
a00330279463aa65e4cbcdf775ed5223c91e466c
Arryboom/LeagueAPI
/include/lol/def/LolLobbyTeamBuilderChampionSelectStateV1.hpp
C++
hpp
3,109
permissive
#pragma once #include "../base_def.hpp" #include "LolLobbyTeamBuilderRerollStateV1.hpp" #include "LolLobbyTeamBuilderCellsV1.hpp" #include "LolLobbyTeamBuilderTradeV1.hpp" #include "LolLobbyTeamBuilderTeamBuilderBoostInfo.hpp" namespace lol { struct LolLobbyTeamBuilderChampionSelectStateV1 { std::string teamId;...
b5e408e8d1e1ccaec23cd46ecd1b0176591cd96e
51151ae8ef231cb13bab8803e2f11d290a4cb40f
monk78/Standard-Algorithms
/mathematics/combinatorics/C_diverseMatrix.cpp
C++
cpp
950
no_license
#include<bits/stdc++.h> using namespace std; //#define Fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define int long long typedef vector<int>Vl; typedef pair<int,int>PII; typedef vector<PII>Vll; typedef vector<pair<int,pair<int,int> > >Vlll; typedef priority_queue<int>PQL; typedef map<int,int>MP; #de...
e3b4f2c23b0195cc898cac890354c22590b38b9b
d1b3a7791cc6ea90a6aee158c3a3258566249ab3
hangzhangac/Algorithm-Problem
/Codeforces/Educational Codeforces Round 78/c.cpp
C++
cpp
1,394
no_license
#include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #include <string> #include <queue> #include <cmath> #include <stack> #include <time.h> #include <map> #include <set> #define mem(a,x) memset(a,x,sizeof(a)) #define gi(x) scanf("%d",&x) #define gi2(x,y) scanf("%d%d",&x,&y) #...
b11097c83c0daec88665b27f5419617820f7565f
7996808286c88292742da36653be43130b5cac5b
alibaba/MNN
/tools/converter/source/optimizer/merge/FuseLayerNorm.cpp
C++
cpp
6,191
permissive
// // FuseLayerNorm.cpp // MNNConverter // // Created by MNN on 2020/07/09. // Copyright © 2018, Alibaba Group Holding Limited // #include <unordered_map> #include "../TemplateMerge.hpp" #include "MNN/expr/ExprCreator.hpp" #include "MNN_generated.h" #include "MergeHelpers.hpp" namespace MNN { namespace Express {...