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
c176ed4f9ed2625995342300b7c8c0b9570b026a
6c2afd777d21bbf57b0b9d47930ffb16dac8dc99
minzydal/CPP_Programming
/3.21 c++/Project1/Project1/static.cpp
C++
cpp
429
no_license
#include <iostream> using namespace std; void function(); void main() { for (int i = 0; i < 5; i++) function(); } void function() { int num = 0; static int snum = 0; //static변수(정적)는 처음 호출 시 단 한번만 초기화된다 //호출되면 변화된 값을 유지한다. cout << num << ", " << snum << endl; num++; snum++; cout << "f...
ec89495ee21dd358cd4f3dfe8b846b6c49623152
b4cd346158ddbffef5fe02757aefc74e2e4cd900
COLA-Laboratory/EMOC
/src/algorithm/nsga2/nsga2.cpp
C++
cpp
6,526
no_license
#include "algorithm/nsga2/nsga2.h" #include <vector> #include <algorithm> #include <iostream> #include "core/macro.h" #include "core/global.h" #include "core/nd_sort.h" #include "operator/tournament_selection.h" #include "operator/polynomial_mutation.h" #include "operator/sbx.h" #include "random/random.h" namespace ...
f7f58f3b4b13f3d2815c90df15bc2de0055a9a1a
9c89587b774a5174711c848703f06d98f0f6066a
Johniel/contests
/atcoder/abc023/A/main.cpp
C++
cpp
1,460
permissive
// atcoder/abc023/A/main.cpp // author: @___Johniel // github: https://github.com/johniel/ #include <bits/stdc++.h> #define each(i, c) for (auto& i : c) #define unless(cond) if (!(cond)) using namespace std; typedef long long int lli; typedef unsigned long long ull; typedef complex<double> point; template<typename...
047e54dc36d9d16e0883da76574d00739eccd2a2
b3be5a164c763afdd41aedcd41fb0d234be6d8c7
sonic-howl/FRC2019
/src/main/include/Boot.hpp
C++
hpp
486
no_license
#ifndef BOOT #define BOOT #include <ctre/Phoenix.h> namespace frc { namespace lcchs { class Boot { public: void moveStrap(double bootSpeed); void elevateBoot(int bootPosition); int getPosition(); void initializeBoot(); private: static constexpr int kFootMotorChannel = 9; static constexpr int kStrapMo...
7e378f467ab30f2a05b8b5d33df8734e308eb218
4c2464ca72a5efad7fde3e384b1fa148e58c7e8d
mayank-75/Algorithms
/DSA/binary_search_codechef_bananas.cpp
C++
cpp
855
no_license
// banging my head why getting TLE, got to learn something today // reason for TLE- /* was sortint the elements, yahh was getting bit lazy to calculate max element and sorting takes nlogn whereas whole binary search takes logn time */ # include<bits/stdc++.h> # define int long long using namespace std ; bool isPossib...
0c0dc7b140d4425e8c0bae4bf233636b9e29dc60
f0f452068bf2cfe19e5ea73dab08b3593886fd1d
lindkvis/Cogmatix
/Libs/LibCogmatix/CompositePart.cpp
C++
cpp
256
no_license
#include "StdAfx.h" #include <osgDB/ReadFile> #include "CompositePart.h" namespace LibCogmatix { void CompositePart::loadGraphics (CoString fileName) { _fileName = fileName; osg::Node* node = osgDB::readNodeFile(_fileName); addChild(node); } }
cc1b203231caadbc36f0d254652ba987c24aa7de
95f091dfce450ccc09034a5350bddc9ca135742e
4l3dx/DBOGLOBAL
/DboShared/NtlGameTable/AirCostumeTable.cpp
C++
cpp
3,658
no_license
#include "StdAfx.h" #include "AirCostumeTable.h" #include "NtlDebug.h" #include "NtlSerializer.h" WCHAR* CAirCostumeTable::m_pwszSheetList[] = { L"Table_Data_KOR", NULL }; CAirCostumeTable::CAirCostumeTable(void) { Init(); } CAirCostumeTable::~CAirCostumeTable(void) { Destroy(); } bool CAirCostumeTable::Creat...
f1b02302608f0099e7c0ac3eeed358a629cf0b7d
e77cc4c645d184ea6e02295df68ae00b6f8dacaa
RenoirTan/dunjudge.me
/lockcode33/old_lockcode.cpp
C++
cpp
465
permissive
#include <bits/stdc++.h> using namespace std; bool isprime(int n) { bool p = true; if (n > 1) { for (int i = 2; i < sqrt(n); i++) { if (n%i == 0) { p = false; }; }; } else { p = false; }; return p; }; int main () { int s; bool b = true; for (int i = 0; i < 4; i++) { ...
4445b3ef6f1058166e6119aa22e8430e9591f970
24cc9a54104153810179231ec8089e425e410f08
Aj163/Computer-Organization-and-Architecture
/systemC/Question 2/Question 2a/main.cpp
C++
cpp
739
no_license
#include <systemc.h> #include "encoder.h" #include "test_bench.h" /* Name : Ashwin Joisa (16CO104) Praveen Raj (16CO115) Date : 16/10/2017 */ int sc_main (int argc,char* argv[]){ sc_signal< sc_uint<16> > a_in; sc_signal< sc_uint<4> > b_in; sc_clock clk_sig("clk_sig",10,SC_NS); sc_trace_file *Tr...
b97c210a4d1e17d000625fcd2679ee42d456480d
828c5d858cb3aea6e0f8b2a789731874996538e6
GDK38/Cpp
/C++ Open GL/1. Tetris/painter.cpp
C++
cpp
679
no_license
#include "painter.hpp" #include <GL/gl.h> void Painter::rect(int x1, int y1, int x2, int y2){ glBegin(GL_QUADS); glVertex2f(x1,y1); glVertex2f(x2,y1); glVertex2f(x2,y2); glVertex2f(x1,y2); glEnd(); } void Painter::setColor(Color color){ static const struct{ ...
3882662fe1dc881856c9b5710491bf683088d42d
da4aa1a244d7ce2525b4678834db1ca81c7c4108
buyanqifan/MusicPlayer
/kugouapi.cpp
C++
cpp
3,231
no_license
#include "kugouapi.h" #include <QJsonDocument> #include <QJsonValue> #include <QJsonArray> #include <QJsonParseError> #include <QJsonObject> #include <QEventLoop> Kugouapi::Kugouapi() { //添加数据库驱动 创建打开数据库 初始化数据库 sql = new SQL; sql->opensql("music.db"); connect(&manager, &QNetworkAccessManager::finished,...
9b304f71312241c7ddb55e66906ee326fa0712d3
48490348e72d667dbb187009a9d1bd8f544be779
codepractice97/SemThree
/Operating Systsems/memory_allocation.cpp
C++
cpp
3,707
no_license
#include<iostream> #include<cstdlib> using namespace std; struct Processes{ int PID,Memory,MID; }; struct MemoryUnit{ int MID,Block; }; class MemoryFit{ public: Processes* process; MemoryUnit* memory; int nProcess,nMemory; void operator=(MemoryFit ob) { nProcess=ob.nProcess; nMemory=ob.n...
2a59e0fab0545e984ce3f85f0d3829263e1590b4
e0870dbe71a5012b97782caa7ff32155cd501411
maaooo/liangshi
/SharedCode/Data/MessagePack/include/msgpack/type/list.hpp
C++
hpp
2,006
permissive
// // MessagePack for C++ static resolution routine // // Copyright (C) 2008-2009 FURUHASHI Sadayuki // // 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.apach...
1ee700b256b307a0a87e334f4aa90b2e8d94c110
58e610168fe824fac0e66f96a31435c564f37c89
marco-c/gecko-dev-comments-removed
/gfx/skia/skia/src/ports/SkFontConfigInterface.cpp
C++
cpp
843
permissive
#include "include/core/SkFontMgr.h" #include "include/core/SkRefCnt.h" #include "include/ports/SkFontConfigInterface.h" #include "include/private/base/SkMutex.h" static SkMutex& font_config_interface_mutex() { static SkMutex& mutex = *(new SkMutex); return mutex; } static SkFontConfigInterface* gFontCon...
e6a26d99fdedbc1339c7e387be61cf466674d00b
6b67302585d7c877d233e82ffc21c576d9c9165e
khotilov/cmssw
/JetMETCorrections/Type1MET/plugins/PFCandResidualCorrProducer.cc
C++
cc
3,569
no_license
#include "JetMETCorrections/Type1MET/plugins/PFCandResidualCorrProducer.h" #include "DataFormats/Candidate/interface/Candidate.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" #include "JetMETCorrections/Objects/interface/Je...
1719052b2e304f987863ecd572fcb57a8729da04
ae00b80dbe7b6594857edff96201a8629c4df4b9
gawallsibya/SGA_C-CPP
/12_2차배열 월드컵 새로운 결과 만들기/0714_report_worldcup/main.cpp
C++
cpp
1,998
no_license
/* 과제 ]] 월드컵 우승... 인정할 수 없다.. 1라운드 [] [] [] [] [] [] [] [] // 8개 char *pQuaterFinal[8] = ??? 2라운드 [] [] [] [] // 4개 char *pSemiFinal[4] = ??? 3라운드 [] [] // 2개 char *pFinal[2] = ??? 4라운드 [] // 1개 char *pWinner = ??? */ #include <stdio.h> #include <stdlib.h> #include <tim...
b0ab253f449dcaa40f4bc2f5812d082b64fd96c0
e01bf3bc3b6943120e1d64c32ef5fcc633d684dc
utopiangit/CompetitiveProgramming
/AtCoder/ABC165/c.cc
C++
cc
621
no_license
#include <cmath> #include <cstdio> #include <vector> #include <map> #include <queue> #include <list> #include <iostream> #include <algorithm> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using P = pair<int, int>; vector<int> pattern(int n, int m, int i) { } int main() ...
54f42fe001900dc0b051e12ff9b8ae480ae4b624
b635fe4ccde942903fdc32aebe771359a33de7f4
manuelfs/TreeMaker
/Utils/src/LeptonProducer.cc
C++
cc
16,192
no_license
// -*- C++ -*- // // Package: LeptonProducer // Class: LeptonProducer // /**\class LeptonProducer LeptonProducer.cc RA2Classic/LeptonProducer/src/LeptonProducer.cc * * Description: [one line class summary] * * Implementation: * [Notes on implementation] */ // // Original Author: Arne-Rasmus Draeger,...
55357d470ddb896d8902b232a4ccf9c2c40ddfa2
cf0a28895eb689b51837489b3bf9b3e5ec287a8f
lucasm0ta/StandYourGround
/src/Component.cpp
C++
cpp
590
no_license
#include "../include/Component.h" #include <iostream> Component::Component(GameObject &assoc) : associated(assoc) { //std::cout<<"Component GO addr:"<<&assoc<<std::endl; } void Component::Start() { // std::cout<<"Started Componend WITHOUT Start"<<std::endl; } void Component::NotifyCollision(GameObject &other...
d28078ca190e66ec257b107dc8761017b0bd1f9c
caa3e92a00e3126b8d6dd8b71134973e9aabb46b
SimonLangowski/libff
/libff/algebra/curves/bn128/bn128_init.cpp
C++
cpp
11,929
permissive
/** @file ***************************************************************************** * @author This file is part of libff, developed by SCIPR Lab * and contributors (see AUTHORS). * @copyright MIT license (see LICENSE file) ***********************************************************************...
b14914228f64ad733d2d379e79e40f0640b2b0f2
23e6e66cfdcf34277494c3ed544e31d69cb40bdd
QuarkCloud/qpid-lite
/qpid-sys/windows/Thread.cpp
C++
cpp
9,966
no_license
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); y...
2943170a2849c5f53b48493425490fc59fd76f91
47f982eafe8f66b2ae8d0dd6be71e637663a7338
dicharmed/architecture_of_computer_systems
/диалоговая панель/диалоговая панель/диалоговая панель.cpp
C++
cpp
4,110
no_license
// диалоговая панель.cpp: определяет точку входа для приложения. // #include "stdafx.h" #include "диалоговая панель.h" #include <commctrl.h> #include "resource.h" #include <windows.h> #include <stdio.h> #define _CRT_SECURE_NO_WARNINGS #define MAX_LOADSTRING 100 BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM); int...
aa557c8e722bfe33ba71285ee68d2f270a851cef
3979a5215d0f074de8c8d9494b2ed36efebc70a9
danielkrupinski/CSGOSimple
/CSGOSimple/valve_sdk/misc/Color.hpp
C++
hpp
2,870
permissive
#pragma once #include <cstdint> #include <iostream> #include <fstream> #include <string> #include <sstream> class Color { public: Color(); Color(int _r, int _g, int _b); Color(int _r, int _g, int _b, int _a); Color(float _r, float _g, float _b) : Color(_r, _g, _b, 1.0f) {} Color(float _r, float _g, float _b, flo...
deafdedbb81424ac406f4cd225931c8a1c866d7b
b4e573066a702b24e10ab342e8734aeda0ba6d1a
foodcoin/foodcoin
/src/util.cpp
C++
cpp
36,639
permissive
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util.h" #include "sync.h"...
8cb331916a3aab93eb562992e601d20715ebe809
17d04c22c8be6ea7dac08d8fcb5427a71479e409
diegoviniciusl/alg1-ufmg
/tp01/src/VaccinationCenter.cc
C++
cc
1,045
no_license
#include "VaccinationCenter.h" VaccinationCenter::VaccinationCenter() { this->id = -1; this->capacity = 0; } void VaccinationCenter::setId(int id) { this->id = id; } void VaccinationCenter::setCapacity(int capacity) { this->capacity = capacity; } void VaccinationCenter::setX(int x) { this->x = x...
d7c4e7fd0a29e9cf636c73c6faf7f5a570299358
10a64c7304864d3265055927ac7b755cb3c8dc99
schinmayee/nimbus
/applications/physbam/physbam-lib/External_Libraries/Archives/boost/boost/test/detail/fwd_decl.hpp
C++
hpp
1,593
permissive
// (C) Copyright Gennadiy Rozental 2005. // 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) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile: fwd_decl.hpp,v $ // ...
a903c1300a62dea3636d1762e07123b8b9e6b465
dc2e327b71fb31c7b94cfd813549686ef575206a
HexColors60/shadow-of-the-wyrm
/engine/XML/source/XMLReader.cpp
C++
cpp
13,576
permissive
#include <sstream> #include "XMLReader.hpp" #include "CombatConstants.hpp" #include "Log.hpp" #include "XMLScriptsReader.hpp" using namespace std; // Parse the symbol information out of an XML node void XMLReader::parse_symbol(Symbol& symbol, const XMLNode& symbol_node) const { if (!symbol_node.is_null()) { u...
6a30686aff7218166e92c183da6edbd2727ddf83
5e91fb8c7c3262a0b9d7b3a3994850948fef2383
alexandraback/datacollection
/solutions_5765824346324992_1/C++/Johnathan/haircut.cpp
C++
cpp
1,503
no_license
#include <iostream> #include <stdio.h> #include <algorithm> #include <map> #include <string> #include <vector> using namespace std; int main(){ freopen("input.in","r",stdin); freopen("output.out","w",stdout); int n = 0; int t; cin >> t; while (n++ < t){ long long int B, N; cin >> B>>N; ...
31af8d2c2eee713b0889fff71a2e1feef4bb0603
51524e192ff66702aa84108e120efd50df836391
Mati365/Rectangle-Adventures
/src/Game/Resources/Data/SoundsPack.cpp
C++
cpp
1,373
no_license
/* * SoundsPack.cpp * * Created on: 17-08-2013 * Author: mateusz */ #include "Resources.hpp" #include "../../Engine/Sound/Sounds.hpp" using namespace Sound; _Sound sounds[DIE_SOUND + 1]; /** * Wczytywanie paczki dźwięków! */ void loadSoundsPack() { sounds[JUMP_SOUND] = {wavPlayer::getInstance().loadSo...
ab177e3f25cbafae1dab94d1ed3b56d2af22752b
267f5973e9514f2a66b6887f2b5fba363c2fc2d0
xiyoo0812/easy2d
/extend/glm/gtc/reciprocal.hpp
C++
hpp
3,808
permissive
/////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentatio...
ab601d5a071b7f7c196202773ec6426bcd1102d8
1d06603a095ec87cd6c445dc2b1b1641de562235
fastcoin-project/fastcoin
/src/validation.cpp
C++
cpp
194,094
permissive
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "validation.h" #include "alert.h" #include "arith_uint256.h" #include "...
f2ca6b28d17d1835713c134a02166e22dd9f169f
e97bf468f9e333fe17d3f372f51875ea4fa1e3cd
guojie1689/redex
/libredex/DexStore.cpp
C++
cpp
3,627
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 <json/json.h> #include <iostream> #include <fstream> #include "DexStore.h" #include "DexUtil.h" constexpr const char* RO...
6988d5e7f5cc7387b104f38dbdb0ad72968a6b6a
84533101123111acff86006232d3e2181b812cc0
ailyanlu/ACMICPC
/Codeforces/CodeForces 550C DP/c.cpp
C++
cpp
1,384
no_license
/*********************************** * * * Auther Rhapsody * * E-mail addf400@foxmail.com * * * ***********************************/ #include <set> #include <map> #include <cmath> #include <queue> #include <vector> #include <cstdio...
d9870685989b7ebbe5987f558e117c8974b68390
b42d48f7a60e4aa5995003a8ff7521bbad18dcae
LanceDai/code
/nower_coder/Multi_University_Training_Contest/2018/three/C_splay.cpp
C++
cpp
3,841
no_license
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAXN = 5e5 + 7; const int INF = 1e9 + 7; int n, m, arr[MAXN]; struct Splay_Tree { struct Node { int father, children[2], key, cnt, _size, rev; inline void init() { father = children[0] = children[1] = key = ...
a86d44668565db64051ac8f6018077572f36b90e
4bdffa239b56383ede39c2570be012edf030a47f
green-fox-academy/mazurgab
/week-03/day-04/CheckerBoard/main.cpp
C++
cpp
3,278
no_license
#include <iostream> #include <SDL.h> //Screen dimension constants const int SCREEN_WIDTH = 480; const int SCREEN_HEIGHT = 480; //Draws geometry on the canvas void draw(); //Starts up SDL and creates window bool init(); //Frees media and shuts down SDL void close(); //The window we'll be rendering to SDL_Window* gW...
b36c4e3940d2835af80110f6805fac948ea2c296
bcba32dee2fe49c73622ae5066797087edd92c6b
lucioeduardo/competitive-codes
/2019/Eduardo/CP3-CAP2/08 - Map/UVA-11286.cpp
C++
cpp
591
no_license
#include<bits/stdc++.h> using namespace std; map<string, int> freq; string aux[5]; int main(){ int n; while(cin>>n && n!=0){ freq.clear(); int qtd_m=0, res=0; for(int i=0; i<n; i++){ for(int j=0; j<5; j++) cin >> aux[j]; sort(aux, aux+5); string join = ""; for(int j=0; j<5; j++) join...
faf8fb9886e89470c02341f3c0db82ce3c84986b
eb59efc80dec9f570099b5f4002ea79d3c6aa0f8
CoinStaging/scrypta
/src/qt/overviewpage.cpp
C++
cpp
23,128
permissive
// Copyright (c) 2011-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The LYRA developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "overviewpage.h" #inclu...
ba8247c6c2ce8d11886d652793ea759bafe668c8
14121c780e549e5d09b14e9d42b98190f11bf1fb
jackodirks/EpochTimeConverter
/epochtohuman.cpp
C++
cpp
2,464
no_license
#include <QDateTime> #include "epochtohuman.h" #include "ui_epochtohuman.h" EpochToHuman::EpochToHuman(QWidget *parent) : QWidget(parent), ui(new Ui::EpochToHuman) { timeSpec = 0; ui->setupUi(this); ui->pushButtonConvert->setAutoDefault(false); connect(ui->pushButtonConvert,SIGNAL(clicked()),t...
9c49365f43e376527a4321a9a72be69d8ec84f51
5df3f74fff73ed91db2844a7c303b645c73f5f6f
adamnemecek/crimild
/core/src/ParticleSystem/Updaters/EulerParticleUpdater.cpp
C++
cpp
3,026
permissive
/* * Copyright (c) 2013, Hernan Saez * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of con...
e81d70236554cf93794e3d74f65eb950edc57a79
baaf3adbf67f59129199df2dbe0bda615c561bf7
zebointexas/courses
/2020_Summer/1_cs5389/Week_2/L2_Materials/Official_Hello/glwidget.cpp
C++
cpp
5,074
no_license
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ...
c4c84431b7e3679b707a4b0ca636c37a30bbeec6
1ebc8eaee64d2a6ced9a54dd9f5e6a8c8f2548cb
jsta/vapour
/src/00headers_dirigible.cpp
C++
cpp
6,974
no_license
#include <Rcpp.h> #include "gdallibrary/gdallibrary.h" #include "gdalwarpmem/gdalwarpmem.h" #include "gdalgeometry/gdalgeometry.h" using namespace Rcpp; // [[Rcpp::export]] Rcpp::CharacterVector vapour_geom_name_cpp(CharacterVector dsource, IntegerVector layer, ...
d17c031ac0d2a6442b5fd645356f841c0f166d2f
bfe5a65560425b87b8abacd0d0584d8caf53db34
vahagnbabajanyan/learning
/qtcute/dictionary_base_gui/AlphaVersion0.1/core_manager.cpp
C++
cpp
1,712
no_license
#include "core_manager.hpp" #include "importer.hpp" #include <QString> #include <QDebug> #include <QThread> #include <iostream> namespace core { coreManager::coreManager() : _importer(0) { std::cout << __func__ << std::endl; } void coreManager::startImportingHandler(const QString& fileName, const QS...
7025dc2ff96698756a0d85a4e4d995a2ca26db2a
9a8dfc0b1d1f2f581d511aea893a014ef854a097
LegendRK/Simplex
/E09 - ARBB/MyRigidBody.cpp
C++
cpp
9,669
no_license
#include "MyRigidBody.h" using namespace Simplex; //Allocation void MyRigidBody::Init(void) { m_pMeshMngr = MeshManager::GetInstance(); m_bVisibleBS = false; m_bVisibleOBB = true; m_bVisibleARBB = true; m_fRadius = 0.0f; m_v3ColorColliding = C_RED; m_v3ColorNotColliding = C_WHITE; m_v3Center = ZERO_V3; m_v3...
fc3cf9eae71a274caca7977a249560dbfc0d2a7c
f12fe53a6c1811b7db9f293368442ca33ec34b80
chaiyujin/media_ffmpeg
/audio_process/sphinx.cpp
C++
cpp
1,781
no_license
#include "sphinx.h" Sphinx *Sphinx::instance = NULL; void Sphinx::initialize() { if (instance) return; instance = new Sphinx(); return; } void Sphinx::run_pcm(const char *file_name, const char *output_name) { instance->config = cmd_ln_init(NULL, ps_args(), TRUE, "-hmm", MODEL_DIR "en-us/en-us...
d816ccef54768e43c2a7d78a8116bdab84b91826
9fd23c5a2d5c29583647444eede20b3071ae9713
ZitaoLi/tsn_omnetpp_nesting_rev
/inet/src/inet/physicallayer/shortcut/ShortcutPhyHeader_m.cc
C++
cc
16,149
no_license
// // Generated file, do not edit! Created by nedtool 5.4 from inet/physicallayer/shortcut/ShortcutPhyHeader.msg. // // Disable warnings about unused variables, empty switch stmts, etc: #ifdef _MSC_VER # pragma warning(disable:4101) # pragma warning(disable:4065) #endif #if defined(__clang__) # pragma clang diagno...
4e6a8421c96eb20ab61fa57ad9dac09898c5bcc3
4440d234c7ae8dae64d6f83a6f965a739206639f
vijaygarg1/UT-Garg-EE382C-EE361C-Multicore
/cuda/NVIDIA_CUDA-7.5_Samples/7_CUDALibraries/jpegNPP/jpegNPP.cpp
C++
cpp
26,746
no_license
/* * Copyright 1993-2015 NVIDIA Corporation. All rights reserved. * * NOTICE TO USER: * * This source code is subject to NVIDIA ownership rights under U.S. and * international Copyright laws. * * NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE * CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT...
457e3d3d14c321a0310e5da1ac9b22e186819e41
fa8337dddf1b4600bece7f757aab24a10007e086
U1ltra/CSC3002_Topic1_OS
/OS_Simulator_seconddraft/monitor/CPUmonitor.cpp
C++
cpp
7,541
no_license
/* * File: monitor.cpp * ----------------- * This file uses Qt libraries to implement the monitor widget. */ #include <iostream> #include <QDebug> #include <QTimer> #include <QLabel> #include <QLayout> #include <QLineEdit> // maybe used to find a specific process #include <QPushButton>...
d0e0c6960a08e267a4ab6cc1c380c87bdab57253
ecf02f7e392d282910c785b1da6f0c1745a16ced
ARM-software/ComputeLibrary
/tests/validation/reference/ArithmeticOperations.cpp
C++
cpp
9,233
permissive
/* * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * * 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 * ri...
716fccf1414408428bc2c7fef177c2f3466b2ef8
7266eceeaa3f3900b548c739819f474dd3dcbddc
binkesi/leetcode_easy
/cpp/n509_FibNum.cpp
C++
cpp
610
no_license
// https://leetcode-cn.com/problems/fibonacci-number/ #include <iostream> #include <vector> using namespace std; class Solution{ public: int fib(int N){ if (N == 0) return 0; if (N == 1) return 1; return (fib(N - 1) + fib(N - 2)); } int fib_a(int N){ if (N <= 1) return ...
6d0805b781648e8970aa97cad9270d2b22f9710f
93fec3a4209ed640eee21f13be9612fcc71b3bff
novobott/Vitis_Accel_Examples
/cpp_kernels/partition_cyclicblock/src/matmul.cpp
C++
cpp
2,709
permissive
/** * Copyright (C) 2019-2021 Xilinx, Inc * * Licensed under the Apache License, Version 2.0 (the "License"). You may * not use this file except in compliance with the License. A copy of the * License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
26827a5415ab42b3a90d798b4e84fb1e2007ac36
f55c3e7809c2bd7a31bb1926dbd8556cb73baec2
rohan-sawhney/direction-fields
/Vertex.cpp
C++
cpp
607
no_license
#include "Vertex.h" #include "HalfEdge.h" std::vector<HalfEdge> isolated; bool Vertex::isIsolated() const { return he == isolated.begin(); } double Vertex::angleDefect() const { double defect = 2 * M_PI; HalfEdgeCIter h = he; do { Eigen::Vector3d u = h->next->vertex->position - h->vertex...
1ee5fc2ca735eddaf6881bb1f4115182c4bacb97
6840ecce587570fb977460366251580d9dac6dab
Mohamedebouguerra/tensorflow
/tensorflow/compiler/mlir/lite/transforms/lower_static_tensor_list.cc
C++
cc
22,706
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...
1336e1b3b9ec295e55b9496f58a483e3fd1be589
890f21109a5fc13cfd8006e5592215ae55c9a7d3
artfin/classical-trajectories
/MPI_TRAJ/tests/potential_test.cpp
C++
cpp
1,299
no_license
#include "ar_he_pes.h" #include "ar_he_pes_derivative.h" #include "ar_he_dip.h" #include <iostream> #include <vector> #include <string> using std::cout; using std::endl; using std::vector; using std::string; void test_dipole( void ) { double r_step = 0.5; double r0 = 3.0; double r, dip; for ( int i = 0; i < 2...
f9506677facd2df7b10d6a3b40f78922f0961b44
2f348ccd26f27f5b1fff399034eff224b786ac4c
zeroengineteam/ZeroCore
/ZeroLibraries/Geometry/Plane.hpp
C++
hpp
1,928
permissive
/////////////////////////////////////////////////////////////////////////////// /// /// \file Plane.hpp /// Declaration of the Plane class. /// /// Authors: Joshua Claeys /// Copyright 2010-2012, DigiPen Institute of Technology /// ///////////////////////////////////////////////////////////////////////////////...
b86f63c3099e6e0e14b18e00f2ac5a85eebf56ed
a00a14b19286031143143f7b6ef0f5c413080684
dktmzdf/maze
/maze/maze/Node.cpp
C++
cpp
546
no_license
#include "Node.h" Node::Node() { this->parent = nullptr; } Node::~Node() { } void Node::SetParent(Node *parent) { this->parent = parent; } void Node::SetX(int x) { this->x = x; } void Node::SetY(int y) { this->y = y; } void Node::SetDirs(char dirs) { this->dirs = dirs; } void Node::SetC(char c) { this-...
26c9c01a0e941b49b3297ab643175fde713b19cd
4fe96b97e0b85b82b0b46ecdd7ba055249023236
bigsaem/Genetic-algorithm-for-the-travelling-salesman-problem
/city.hpp
C++
hpp
1,124
no_license
// // Created by Hysteresis on 2019/3/8. // #ifndef ASSIGNMENT2_CITY_HPP #define ASSIGNMENT2_CITY_HPP #include <iostream> #include <cmath> class city { private: //name of the city std::string name; //x coord of the city double x; //y coord of the city double y; public: //not allowing def...
28b95cce986ffcf2a7ae8ab2124f4769aba6376d
84003722dbc026ce876d77e3c3e59d974a59110d
nightdomain/winner
/core/BytesChannel.cpp
C++
cpp
5,924
permissive
/* Copyright (C) 2014-2015 别怀山(foolbie). See Copyright Notice in core.h */ #include "core.h" namespace core{ /*** BytesChannel impl ***/ /** ctor & dtor **/ BytesChannel::BytesChannel() : m_cycle_buffer(0) , m_event_fd(INVALID_FD) , m_pushable(false) , m_on_event(0) , m_ctx(0){ } BytesChannel::~BytesC...
cb2cca2cc559256ea9589225901be19546f8f717
117b6844d022894f20eb4aea07b0dc56553a6380
belven/RPG
/Source/RPG/Weapons/Weapon.cpp
C++
cpp
3,613
no_license
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "Weapon.h" #include "RPG.h" #include "Characters/RPGCharacter.h" #include "Items/Item.h" AWeapon::AWeapon() : Super() { SetType(EItemType::Weapon); } float AWeapon::GetChangeAmount() { float tempDamage = settings.he...
5f019cd60bf0f82a25fc470a46b60813dbfcfc62
90e004de8b6677a39359f9188f9b3f59b9b456ec
EtlamGit/minutor
/worldsave.cpp
C++
cpp
9,039
permissive
/** Copyright (c) 2013, Sean Kasun */ /* Saves the world to PNG. It doesn't use stock PNG code because the resulting image might be too large to fit into RAM. Therefore, it uses a custom PNG generator that will handle *huge* worlds, but make less-than-optimal PNGs. */ #include <zlib.h> #include "worldsave.h" #...
a7e4bb620f96d168f7e1076b832e0fbd43c20aa6
ac7cfe422d312f4da81f52a55fbd546b70048256
kungfu-monkey/Supernova
/Supernova/projects/msrv/multimedia/mmbrowser/src/MSrv_MediaSubtitleFileManagerEx.cpp
C++
cpp
8,934
no_license
//<MStar Software> //****************************************************************************** // MStar Software // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. // All software, firmware and related documentation herein ("MStar Software") are // intellectual property of MStar Semiconduc...
237112e679a5f476c983823b44f3a7923e160605
1128c887b5b50878b4476727772d5662fee07fd0
yparam98/hhvm
/hphp/runtime/base/bespoke/layout.cpp
C++
cpp
17,473
permissive
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | +--------------...
38c195b2b09315e4b2593d313b2753ee911528dc
8ca0654a5e01f9a07288693f623baa4721cfecb1
TheLostIn/database__2016-2017
/final_big_work/sort/Select_sort.cpp
C++
cpp
889
no_license
#include<iostream> #include<fstream> using namespace std; int maxn=30000; void read_numbers(int* b,int type) { fstream f1; char a[20]; char *p; p=a; switch(type) { case 0: p="order_number.txt"; break; case 1: p="invert_number.txt"; break; case 2: p="random_number.txt"; break; default: ...
82afde2cf7352488798b4bbb6e84b5328114efdd
0244d255323276f6774ffcd37dd892de2de3e1f4
akin666/ice
/lib/graphics/framebuffer.cpp
C++
cpp
2,697
no_license
/* * framebuffer.cpp * * Created on: 3.4.2010 * Author: akin */ #include "framebuffer.h" #include <system/opengl> #include "texture/gtexture.h" namespace ice { Framebuffer::Framebuffer() { m_depth = 0; m_width = 0; m_height = 0; m_id = 0; } Framebuffer::~Framebuffer() { ...
e5ddef28ed6bcbcda188ab26fb26da8524a3b507
9fdadbf552fd74a54ac58baa6db0b6d40ea75584
toastedchicken/Lemmings
/src/DoorStandard.cpp
C++
cpp
546
permissive
#include <iostream> #include "DoorStandard.h" #include "Game.h" #include "ShaderManager.h" void DoorStandard::init() { doorSprite = Sprite::createSprite(glm::vec2(41, 32), glm::vec2(1.f / 3, 1.f / 8), &ShaderManager::getInstance().getShaderProgram(), &Game::spriteSheets().doorSprites); escapeOffset = glm::vec2(13,1...
6f5f1faaebbbca797002b65cf1ceab40260db38a
d83727fbc6c2dbedb8d3186209020ef9bab1479f
Mu-L/behaviac
/src/behaviortree/nodes/decorators/decoratorcountlimit.cpp
C++
cpp
3,822
permissive
///////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Tencent is pleased to support the open source community by making behaviac available. // // Copyright (C) 2015-2017 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the BSD 3...
a4719eb3f5f8f9a602dc5ed36c51b41fb5076160
bb61dbf5a66defbd05102a39561d246bbf72ba12
orangeate/design_patterns
/SimpleFactoryPattern/Product/ConcreteProductA.cpp
C++
cpp
227
no_license
#include "ConcreteProductA.h" #include <iostream> using namespace std; ConcreteProductA::ConcreteProductA() { } ConcreteProductA::~ConcreteProductA() { } void ConcreteProductA::Use() { cout << "use productA" << endl; }
6de7b17a537b913570e79e2ec08908f0457800e4
5bfd5844cd2b93b9c9d7bf651b195a29cece2005
SifuUA/Picine-CPP
/rush00/ClassPlayer.hpp
C++
hpp
535
no_license
#ifndef CLASS_PLAYER_H # define CLASS_PLAYER_H #include <ncurses.h> #include "ClassEnemy.hpp" class Player { unsigned int _x, _y; int _chr; WINDOW *_win; // int _countLife; public: Player(); Player(WINDOW *win, int chr); Player(Player const &src); ~Player(); Player &operator=(Player const &src); void...
806e7bfbbbeaf5f9b65e47027be3d006b5095be3
562c30ef86edcc490dbf04763117904aebec003d
sockyone/breakout-game-c
/broad.cpp
C++
cpp
1,614
no_license
#include <SDL.h> #include "broad.h" #include <random> board::board(SDL_Renderer* renderer) : base(renderer) { SDL_Surface* surface_temp = NULL; surface_temp = SDL_LoadBMP("red_block.bmp"); brick_texture[RED] = SDL_CreateTextureFromSurface(renderer,surface_temp); surface_temp = SDL_LoadBMP("blu...
26d5386293bee56ae17718522d9aea3efb3ba9d8
fd2e2a1bed4f9fbe1217fe94082d01c64dc9fa40
Csineneo/Vivaldi
/chromium/chrome/browser/ui/browser_ui_prefs.cc
C++
cc
5,694
permissive
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/browser_ui_prefs.h" #include <memory> #include "base/numerics/safe_conversions.h" #include "build/build_config.h" #inclu...
eb9dfe686faeb829fa8ce5339ec08d81c844b14a
d088dbb96c7cc5f804c2c0a52b2c1c5b2b1325c6
Saronite/saronite-protocol
/tests/unit_tests/service_nodes.cpp
C++
cpp
16,207
permissive
// Copyright (c) 2018, The Loki Project // // 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 list of // ...
8ba8d77ac834ad82d68a6cbc236ed768b727f8c7
e80e6e0db108a723d102d7d4e7c53bdf5da862af
420xincheng/c
/C语言/函数/作业6判断是否为素数.cpp
C++
cpp
422
no_license
/*编写函数判断一个数是否为素数,在主函数中调用该函数输出100以内的全部素数,每行输出5个数。 */ #include <stdio.h> void main () { int is(int m); int i,k=0; for (i=1;i<101;i++) { if (is (i)) { printf ("%d ",i); k++; if (k%5==0) printf ("\n"); } } } int is(int n) { int i; for (i=2;i<n;i++) if (n%i==0) break; if (i==n) return 1; ...
8074525a58ff6ec1517103f6f202ff9f34906d1f
8228ee280c1e257a703c9a6cd9b14adb5acd20c5
leyicai/LeetCode-Solution
/cpp/51_N-Queens.cpp
C++
cpp
926
no_license
class Solution { public: vector<vector<string>> solveNQueens(int n) { vector<vector<string>> res; vector<string> nQueens(n, string(n, '.')); vector<int> flag_col(n, 1), flag_45(2 * n - 1, 1), flag_135(2 * n - 1, 1); N_Queens(res, nQueens, flag_col, flag_45, flag_135, 0, n); return res; } private: void N_Qu...
518d4b0494431d11b0d12990a763394efc40cbef
f95b1df4ecd5d69d87b7d6b0842c58992403d064
marenan/HLS-Tiny-Tutorials
/interface_hls_stream/bytestrm_dwordproc.cpp
C++
cpp
2,523
permissive
/* * Copyright 2019 Xilinx, 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 i...
53ea011ab615b1d7b371b968a7c0897e0784d3d6
410dfb70ec3e5888e776d1e6b6b622fe1f35f7fe
dmiyyy/AywaCore
/src/test/crypto_tests.cpp
C++
cpp
16,245
permissive
// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "crypto/ripemd160.h" #include "crypto/sha1.h" #include "crypto/sha256.h" #include "crypto/sha512.h" #include "crypto...
22da61b304c85df9fc3ac90b1a1e20e42c826f16
1ec6995a369a6997ff99158525a657c34ccf5120
ismailturan/src
/HEP/Eps.cpp
C++
cpp
6,030
no_license
/** * @file * @brief Functions for Levi-Civita Tensor */ #include "HEP.h" namespace HepLib { //----------------------------------------------------------- // Eps Class //----------------------------------------------------------- GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(Eps, basic, print_func...
f616049a6753565fadc117ac0d83e02b14fe9499
103d2c53807a568a103abfc5a175a0f6d032a90c
stone-SJH/Algorithm
/POJ/POJ3281-Dining/Solution.cpp
C++
cpp
1,526
no_license
#include <iostream> #include <queue> using namespace std; #define MAX 403 int tab[MAX][MAX]; int dis[MAX]; int source, sink; int total; void build(){ int n, f, d; cin >> n >> f >> d; memset(tab, 0, sizeof(tab)); source = 0; sink = 2 * n + f + d + 1; total = sink + 1; for (int i = 1; i <= f; i++) tab[source]...
def1856008ac4f3c8aa358d3be82bc351bc81b65
f05717c268a24c6eff3e8dc43a3d53e03858be39
suenosdev/suenos
/src/alert.cpp
C++
cpp
8,606
permissive
// // Alert system // #include <algorithm> #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/replace.hpp> #include <boost/foreach.hpp> #include <map> #include "alert.h" #include "key.h" #include "net.h" #include "sync.h" #include "ui_interface.h" using namespace std; map<uint256,...
2d987965605d98abfa735f5e294b30c3b9bdac05
5992ce5793e9300959294f8e09c27dddd6dbebfd
H4112/GrammairesLangages
/rendu/src/etats/E20.cpp
C++
cpp
2,664
permissive
/************************************************************************* E20 - Etat de l'analyseur ------------------- début : 8 mars 2016 10:43:21 copyright : (C) 2016 par H4112 ***********************************************...
15c6080ea2439006060e3b5a890de0e2144af0bb
205b590e8674a757827ce6446bc699cfb64fe687
pufit/FCS-PFaM-2019
/2/3-dates.cpp
C++
cpp
1,234
no_license
// // Created by pufit on 25.01.2020. // #include <iostream> #include <cstdint> #include <tuple> using i32 = int32_t; struct Date { i32 day{0}; i32 month{0}; i32 year{0}; }; template<typename T> T Read() { T value; std::cin >> value; return value; } std::ostream& ...
4aab626a55aa5dea86d517aaffe54185f7982f06
bc247185c533f22d5d9540cc19656679b3518ed4
Team302/2020InfiniteRecharge
/src/main/cpp/states/shooterHood/ShooterHoodManual.cpp
C++
cpp
994
permissive
#include <memory> #include <states/shooterHood/ShooterHoodManual.h> #include <states/IState.h> #include <subsys/IMechanism.h> #include <subsys/MechanismFactory.h> #include <gamepad/TeleopControl.h> #include <controllers/ControlModes.h> using namespace std; ShooterHoodManual::ShooterHoodManual ( ControlData* cont...
c9903ba34b4ffa8792ae22d39e39b6042b04b6fd
b06e9caf6d587c1d26b38cac5c950f00d15da9a7
Husain0007/HackerBlocks
/Algorithms/PascalsTriangle1/p.cpp
C++
cpp
816
no_license
#include <iostream> using namespace std; int fact(int n) { int result[10] = {0}; if (n >= 0) { result[0] = 1; for (int i = 1; i <= n; i++) { result[i] = i * result[i - 1]; } return result[n]; } return 0; } void PascalsTriangle(int n) { if (n ...
600867fe14c5265fbdd5b2cac46cf498fb2b0208
731eadefdd4e3b129b1bb53f4a2a13f0b77472f4
matix522/foc_libraries
/test/small_vector_test.cpp
C++
cpp
26,662
permissive
// SmallVector unit tests. // // Based on llvm/unittest/ADT/SmallVectorTest.cpp #include <algorithm> #include <cstdarg> #include <list> #include <utility> #define CATCH_CONFIG_MAIN #include "../catch.hpp" #define SMALL_VECTOR_IMPLEMENTATION #include "../foc/array_ref.h" #include "../foc/small_vector.h" #include "te...
32e3ef2990c1fce927f346b963f2aca40b9d6201
5f3501f4eee4707200ca78440bcb9173314bb476
blowing-wind/pat_advanced
/1119.cpp
C++
cpp
802
no_license
#include <iostream> #include <vector> using namespace std; int N, pre[30], post[30]; vector<int> in; bool judge(int b1, int e1, int b2, int e2); int main() { int i; cin >> N; for (i = 0; i < N; i++) cin >> pre[i]; for (i = 0; i < N; i++) cin >> post[i]; if (judge(0, N - 1, 0, N - 1)) cout << "Yes" << endl...
2656f4bc677f839cadd86d8347cc34e0df24383b
3d297331a9b6595f20b6d59f09dfa31e5192d8aa
T20X/practice
/CPP/TopCoder.hpp
C++
hpp
2,429
no_license
#pragma once void pushToQueue(queue<node> q, node v) { if (visited[v.player1X][v.player1Y][v.player2X][v.player2Y]) return; q.push(v); visited[v.player1X][v.player1Y][v.player2X][v.player2Y] = true; } int minTurns(String[] board) { int width = board[0].length; int height = board.length; node start; // Find th...
816f265ee5138e87daf1c474a9d0786916ef7c4b
632e99120a4ecb227bcc61e0ed9025b3e9658485
pytorch/xla
/torch_xla/csrc/ops/linspace.cpp
C++
cpp
1,378
permissive
#include "torch_xla/csrc/ops/linspace.h" #include "torch_xla/csrc/helpers.h" #include "torch_xla/csrc/lowering_context.h" #include "torch_xla/csrc/xla_lower_util.h" namespace torch_xla { Linspace::Linspace(const torch::lazy::Value& start, const torch::lazy::Value& end, int64_t steps) : XlaNode...
ae6528c3472a634ad06e93f30a060a2084f9067c
2e3f2236acf39c2cb60f0a244eca5ded734861a2
ezEngine/ezEngine
/Code/ThirdParty/RmlUi/Source/Core/GeometryUtilities.cpp
C++
cpp
5,058
permissive
/* * This source file is part of RmlUi, the HTML/CSS Interface Middleware * * For the latest information, see http://github.com/mikke89/RmlUi * * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd * Copyright (c) 2019 The RmlUi Team, and contributors * * Permission is hereby granted, free of charge, to...
038748b2da42304ea76c2ed8b1793a682972c770
a70f6922e66d576e41e9174f6e3ef30857b2d918
CU-0xff/juliet-cpp
/000/068/191/CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_wchar_t_memcpy_84a.cpp
C++
cpp
2,358
no_license
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_wchar_t_memcpy_84a.cpp Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193.label.xml Template File: sources-sink-84a.tmpl.cpp */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Allocate ...
08d539bd9d449d640a5eeed5b39197e659010d28
676aca66593370dd20866c0d07e51b083c294987
ysripath/Practice
/mergeSort.cpp
C++
cpp
1,275
no_license
#include <iostream> #include <vector> using namespace std; vector<int> merge(vector<int> a, vector<int> b) { vector<int> r; auto itrA = a.begin(); auto itrB = b.begin(); while (itrA != a.end() && itrB != b.end()) { if (*itrA <= *itrB) { r.push_back(*itrA); itrA++; } else { r...
2648e1934b0868b52f75d4a38246ef82341f8851
ace4da31a6fb458f24220174d9d6a01f7f42080f
lrmodesgh/pothos
/pothos-blocks/digital/Scrambler.cpp
C++
cpp
5,088
permissive
// Copyright (c) 2015-2015 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include "lfsr.h" #include <Pothos/Framework.hpp> #include <iostream> #include <cstring> #include <algorithm> //min/max /*********************************************************************** * |PothosDoc Scrambler * * The scrambler block im...
b4341ce96425a8d46f92212da839ea9441f49a3b
6f4dc53e39328f208d77c3c529411b1c45e6f239
drakh/LuxCore
/source/main.cpp
C++
cpp
35,963
permissive
//// windows shit #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #define NOMINMAX //// end of windows shit #include <ctime> #include <mutex> #include <chrono> #include <thread> #include "vectary_data/decoder.h" #include "utilities/log.h" #include <stdlib.h> #include <cstdlib> #include <thread> #inclu...
9020844fc308704ef32201ac1b357377fa57eced
edeaf6ca80bd8b4d990d66ac192281f7ba4713e1
LukasNevrkla/CoilGun_006_ESP32
/CoilGun_006_ESP32/Sensors.cpp
C++
cpp
5,934
no_license
#include "Sensors.h" void(*ToCall_interrupt)(byte); //void(*ToCall_end)(); //portMUX_TYPE mux_second = portMUX_INITIALIZER_UNLOCKED; void IRAM_ATTR SInt_0() { SensorInterrupt(0); } void IRAM_ATTR SInt_1() { SensorInterrupt(1); } void IRAM_ATTR SInt_2() { SensorInterrupt(2); } void IRAM_ATTR SInt_3() { SensorInterru...
4dcd3f4a75da999c9e47693d76e9955509c907aa
1ba07b8e05604976abb32d69eb48c6ca4c1714ad
smagri/uni_masters
/pms/peerCodeReviews/ass2/code/two/Assignment2_12005043/rangerfusion.cpp
C++
cpp
10,033
no_license
#include "rangerfusion.h" #include <iostream> RangerFusion::RangerFusion() { FusionMethod_ = "Minimum"; Output = {}; maxsize_ = 0; vf = {}; } void RangerFusion::setRangers(vector<Ranger*> RangerSensors){ //setter for vector of ranger classes to used to in get fused data function RangerSensors_ = ...
f827a2949b666c08810078a97d4eccb8530b4543
411d5465d6f9938a3e369054591dd072090e0940
hiroto1130/FoodReversi
/FoodReverse/FoodReverse/Scene/Game/GameScene.cpp
C++
cpp
868
no_license
#include "GameScene.h" void GameScene::Draw() { for (auto data : textureData) { texture->Draw(*data); } manager->Drow(); } void GameScene::Update(Library::Key& key) { manager->Update(key); if (manager->GetGameState() == true) { myScene = SceneName::ResultScene; } } SceneName GameScene::Exit() { retur...
63191fa960ce66dfb91c0131730863eb6616da29
93c6c557d9ba17d38852d34ad4b26e6cff8cb562
NiklausAizen/my-graduation-project
/NW模型逆向转化/NW模型逆向转化/first blood.cpp
C++
cpp
874
no_license
#include <iostream> #include <vector> #include <list> #include <algorithm> using namespace std; //本程序演示NW小世界模型的逆向演化 int N_number;//网络的节点数 int N_edge;//网络的边数 vector<list<int>> g;//邻接表存储的网络,通过读取文件对其进行初始化 vector<list<int>> regular;//存放演化结束后的网络 struct p_point { int x; int y; }; void Init_network(){//初始化网...
f956a921183c39a131dc5a43dc8c1e95c3fbbcf8
3d4ad1a7f98ad9f0992d59a94d193d462036a311
SKnight-CN/SK-31
/amazon/main.cpp
C++
cpp
6,325
no_license
#include<cstdio> #include<cstring> #include<queue> #include<algorithm> using namespace std; //have a try //have another try struct node1 { int Write_MinStep; int Blake_MinStep; }; node1 StrMap2_Q[11][11], StrMap2_K[11][11]; char StrMap1[11][11]; struct node2 { int x, y; int step; }; int vis1[11][11]...
ad76a68b90f8c49fe61552a5679d5bbc36432933
d74f098478ae72d8c921b84964c7fcd1e0fbb62d
nuuts/nuuts
/src/noui.cpp
C++
cpp
1,806
permissive
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2016 The SaruulCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "noui.h" #include "ui_interface.h" #include "util.h" #include <cstdio> #...
9a26f6ec298738ebdf57cbc2433a07d6e9d724b3
0538beea95f7eff607bf660c04892ce317a12388
blockspacer/compute-runtime
/opencl/test/unit_test/mem_obj/image_set_arg_tests.cpp
C++
cpp
55,074
permissive
/* * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/gmm_helper/gmm.h" #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/ptr_math.h...
e4ef1ed0afee106fd66db8ebfaa99f85526de6c6
71cba0dfe525aab1a1af8a4094079e736ff24ede
Aktyn/Genetic-Algorithm
/src/cpp/ga/main.cpp
C++
cpp
5,843
permissive
#include "buffer_evolution.h" #include "network_evolution.h" #include "tsp_evolution.h" #include <cstdio> #include <cstring> #ifndef __EMSCRIPTEN__ void testBufferEvolution() { const char* target_sentence = "EVERYBODY DANCE NOW"; const uint32 length = strlen(target_sentence); const uint32 population = 256; B...
58d026b4216220869793419eccaf4dd4c5f8b2ec
843480382370b1932b2b416ee91dda373d746b13
ksy9164/FT-Tree-On-FPGA
/utils/finding_template_matched.cpp
C++
cpp
1,827
no_license
#include <iostream> #include <string> #include <fstream> #include <vector> #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/classification.hpp> using namespace std; using namespace boost::algorithm; #define LOG_NUM 4 #define ID 0 const char log_file_name[LOG_NUM][100] = { "/mnt/hdd0/data/h...
825ff59a925ca7b3abb672d9131ccf128c890172
6783b33ba7ba05c6202486895f53c3e5ba10d768
Shubham-js/Codes
/aditya verma/stack/minimum_element_in_stack1.cpp
C++
cpp
674
no_license
#include <bits/stdc++.h> using namespace std; stack<int> s; stack<int> ss; void minimum() { if (ss.size() == 0) { cout << -1 << endl; return; } else { cout << ss.top() << endl; return; } } void pop() { if (s.size() == 0) { cout << -1 << endl; return; } int ans = s.top(); s.pop(); if (ss.top() ...