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 |
|---|---|---|---|---|---|---|---|---|
5c4d43e089f7d9ba95062adf300d6b9938051e2f | e97c0c7b29806a37f78cb97dc56094a9321263ad | Bia10/clrn | /projects/http/AuthPlugin/src/Registrator.cpp | C++ | cpp | 4,809 | no_license | /*
* Registrator.cpp
*
* Created on: Dec 17, 2011
* Author: root
*/
#include "Registrator.h"
#include "Singletones.h"
#include "Exception.h"
#include "UserInfo.h"
#include "Crypto.h"
#include "MailSender.h"
#include "Converter.h"
CRegistrator::CRegistrator()
{
}
const TCHAR *CRegistrator::Description()
{... |
de7b673ac660575e04b624766c7c3263b2b91b7f | 9fb8811af4194c1ac759521c165c67dfe87983eb | LiamTyler/Progression-Vulkan-Old | /progression/graphics/graphics_api/sampler.cpp | C++ | cpp | 1,230 | permissive | #include "graphics/graphics_api/sampler.hpp"
#include "core/assert.hpp"
namespace Progression
{
namespace Gfx
{
void Sampler::Free()
{
PG_ASSERT( m_handle != VK_NULL_HANDLE );
vkDestroySampler( m_device, m_handle, nullptr );
m_handle = VK_NULL_HANDLE;
}
std::string Sampler::Ge... |
c3075ecb35b6ed46fcb9736a4bcc3a36929dbf1b | 0dc2a99dceb108f449e22233cfa3d74035466d8f | LGDAiiR/okko | /Xtraylex-master/hooks/hooks/hooked_drawfog.cpp | C++ | cpp | 465 | no_license | // This is an independent project of an individual developer. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com
#include "..\hooks.hpp"
bool __fastcall hooks::hooked_drawfog::hook(void* ecx, void* edx)
{
return !g_cfg.esp.removals[REMOVALS_FOGS] || g... |
8f9445ac46238558f0ebb170dc77883ffb301974 | c764638d20eccf825e8175352167d39cd564a249 | GCSPS/WealthCurrency | /src/irc.cpp | C++ | cpp | 11,029 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bignum.h"
#include "sync.h"
#include "irc.h"
#include "net.h"
#include "s... |
09096b8740854f0803758db690a926e8a20704ee | 21bed5011d4e80816c42a1d5692dfa5c2e9b4d57 | Damiankk-dev/KsiazkaAdresowaZgodnaZKursem | /PlikZAdresatami.cpp | C++ | cpp | 10,617 | no_license | #include "PlikZAdresatami.h"
void PlikZAdresatami::dopiszAdresataDoPliku(Adresat adresat){
string liniaZDanymiAdresata = "";
fstream plikTekstowy;
plikTekstowy.open(pobierzNazwePliku().c_str(), ios::out | ios::app);
if (plikTekstowy.good() == true) {
liniaZDanymiAdresata = zamienDaneAdresat... |
fcda1c0739d41e24ddb4a8443f1ace5c6f45c8c8 | dc8bf7d01ae01652ac92e6ceb9892eba004749d6 | yashgugale/OpenGL-Assignments | /OpenGL_On_Windows/01-Native/Set-07(05-11-17)/01-2D and 3D Textures/04-Checker board/04-Checker board.cpp | C++ | cpp | 9,348 | no_license | #include <windows.h>
//OpenGL headers
#include <gl/GL.h>
#include<gl/GLU.h>
#define WIN_WIDTH 800
#define WIN_HEIGHT 600
#define checkImageWidth 64
#define checkImageHeight 64
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"glu32.lib")
//Prototype Of WndProc() declared Globally
LRESULT CAL... |
9af58ffe270e6dba9410bca674a4c46ecd4c6cd1 | 682e9e4ed2991778a3389e5f2f5ac9a727ebd9bc | alexandraback/datacollection | /solutions_5769900270288896_0/C++/tgehr/b.cpp | C++ | cpp | 1,253 | no_license | // -*- compile-command: "g++ -g -Wall -Wextra -DLOCAL -std=c++11 -D_GLIBCXX_DEBUG b.cpp -ob && ./b " -*-
#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define MP make_pair
#define sz(v) ((in)(v).size())
#define all(v) (v).begin(),(v).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define forv(i,v)... |
7540bf55332e21e2101dbe85b01da145274b18b8 | d90035e59bd0bcf0d5613782aae2b96d9746c840 | doterkuile/webots_synthetic_data | /controllers/camera_controller/src/camera_utils.cpp | C++ | cpp | 3,714 | no_license | #include "camera_utils.hpp"
namespace camera_utils{
void turnCameraOn(webots::Camera* camera, int time_step)
{
camera->enable(time_step);
camera->recognitionEnable(time_step);
camera->enableRecognitionSegmentation();
}
bool saveImages(webots::Camera* camera, webots::Display* display, webots::Node* object... |
0313e1d9d1a27bd09a04244e60f260d3689f90a1 | be30f2ff3ceacddbbd546947306178c6c39ef224 | danhleth/CS202_19APCS1_Game | /mainProgram/Across_The_Road/Movement.cpp | C++ | cpp | 434 | no_license | #include "Movement.h"
//Constructor - Destructor
Movement::Movement(float maxVeclocity)
{
this->maxVeclocity = maxVeclocity;
}
Movement::~Movement()
{
}
const sf::Vector2f Movement::getVeclocity()
{
return this->veclocity;
}
//Fucntions
void Movement::move(const float x, const float y)
{
this->veclocity.x = this... |
8d5b18090699b19c487e2d727fd95b7dfffcdf82 | a33cad8e1a2214ae3c92ffeeb53cc17e2be5d875 | youtube/cobalt | /third_party/llvm-project/libcxx/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp | C++ | cpp | 2,163 | permissive | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
6b10c380986762bca61dfe5f2c3229097df8b724 | 23ed6d1f35542cf8ee458e753f009b2d3987bcd0 | coin-au-carre/cointools | /include/coin/math.hpp | C++ | hpp | 5,374 | permissive | #pragma once
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <stdexcept>
namespace coin {
template<typename T>
bool compare(T x, T y, T epsilon = std::numeric_limits<T>::epsilon()) {
T one = 1.0;
T max_x_y_one = std::max( { one, std::abs(x) , std::abs(y) } ) ;
return ... |
a7d403699286565aa02b2a58ccbd2ff95bfd067c | 75ad9b1e3b6c68139bc0957767df546739ab8f63 | aoguangcheng/AlgorithmAndDataStructure | /字典序列最小.cpp | C++ | cpp | 547 | no_license | #include<stdio.h>
int main()
{
int n;
int high;
int low;
int i;
char a[100];
char s[100];
scanf("%d\n", &n);
for(i = 0; i < n - 1; i++)
{
scanf("%c\n", &s[i]);
}
scanf("%c", &s[i]);
i++;
s[i] = '\0';
low = 0;
i = 0;
high = n - 1;
while(low < high)
{
if(s[hig... |
d5ff9b56b12c170ed989ba69148a39326ede7a31 | 34fd02b9044a7ff48dbcf7a814083e0bd16c802f | niuxu18/logTracker-old | /second/download/collectd/gumtree/collectd_repos_function_1699_collectd-5.1.0.cpp | C++ | cpp | 1,646 | no_license | static int wg_format_values (char *ret, size_t ret_len,
int ds_num, const data_set_t *ds, const value_list_t *vl,
_Bool store_rates)
{
size_t offset = 0;
int status;
gauge_t *rates = NULL;
assert (0 == strcmp (ds->type, vl->type));
memset (ret, 0, ret_len);
#define BUFFER_ADD(...)... |
278098e3b774d7a9b7e9011fb543cb3bf77d41ed | d8b6840750e0801491dbf76e624eb83c816dacb9 | sabil62/Floatsat | /codes/obc/dependencies/rodos/tutorials/70-network-and-io/10-udp/udpreceiver-broadcast.cpp | C++ | cpp | 445 | permissive |
#include "rodos.h"
static Application receiverName("UDPReceiver");
static UDPIn in(-5001); // negative to allow several to listen the same port
class Receiver : public StaticThread<> {
char userData[2000];
void run () {
TIME_LOOP(1*SECONDS, 20*MILLISECONDS) {
while(int len = in.get(userData, 200)) {
P... |
3c46a77a7315a3ccfd6c013d1cd469667ad812ff | 559dfa31306035286ce6594bdfac09723d22b8e8 | molllyn1/kwallet | /src/runtime/kwalletd/kbetterthankdialog.cpp | C++ | cpp | 1,464 | no_license | /*
This file is part of the KDE libraries
SPDX-FileCopyrightText: 2004 George Staikos <staikos@kde.org>
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "kbetterthankdialog.h"
#include <QIcon>
KBetterThanKDialog::KBetterThanKDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
con... |
e5c97af857187c0734bc12372cf7742b3386aa60 | 711800885b75570add963a29dd0128786e1d925e | abradifcode/angle | /src/libANGLE/FrameCapture.cpp | C++ | cpp | 166,893 | permissive | //
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// FrameCapture.cpp:
// ANGLE Frame capture implementation.
//
#include "libANGLE/FrameCapture.h"
#include <cerrno>
#include <cstring>
#incl... |
026aa09f443c6d2228497383d81b897b5b89ad1e | a7c26dd8c9077475424eae1cd9ea89ab355826c6 | ThomasvanBommel/matrix-transpose | /src/main.cpp | C++ | cpp | 333 | no_license | /**
* @author Thomas vanBommel
* @since 01-08-2021
*/
#include "Matrix.h"
#include <iostream>
using namespace std;
int main(){
Matrix A{5, 3};
A(0, 0) = 1;
A(1, 1) = 2;
A(2, 2) = 3;
A(4, 0) = 7;
A(4, 1) = 8;
A(4, 2) = 9;
cout << A << endl;
A.transp();
cout << A << endl;
... |
dea2c3ee8ac8e5eaeaca6b19f863a0dc2f02d97a | e4e15172a6cc0231399888fcf2367ed46b532ce4 | asdlei99/coding_interviews | /30_min_in_stack.cc | C++ | cc | 981 | no_license | #include <iostream>
#include <stack>
#include "macro_util.h"
using namespace std;
class Solution {
public:
void push(int value) {
s_.push(value);
if (min_s_.empty()) {
min_s_.push(value);
} else {
if (value < min_s_.top()) {
min_s_.push(value);
... |
716087704e3cbe77d6466f042078981cd9f70591 | 5ff703102550adac4abc3fd78147514958cb390b | liuxinren456852/vxl | /contrib/brl/bseg/boxm2/ocl/pro/processes/boxm2_ocl_kernel_vector_filter_process.cxx | C++ | cxx | 1,796 | no_license | //:
// \file
// \brief A process to filter a boxm2 scene with a vectors of bvpl_kernels
// \author Isabel Restrepo
// \date April 12, 2012
#include "boxm2_ocl_kernel_vector_filter_process.h"
//:sets input and output types
bool boxm2_ocl_kernel_vector_filter_process_cons(bprb_func_process& pro)
{
using namespace box... |
94abe538683ea04505f816d106743e2621216b3c | 68a0b9131cf5ed69db8a9d44095d1632d9b0e290 | photonicfusion/PhotoniClock | /Firmware/Preload/crc8.cpp | C++ | cpp | 2,406 | no_license | /*
* Copyright (c) 2017 nitacku
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, di... |
9c385a84eff938dcf0a067a07af2336de801e669 | 97f2b7f3d89f08a663fef028fb914ec113a5c261 | hiandy168/Note_of_IOI | /算法模版/AL/divide.cpp | C++ | cpp | 1,807 | no_license | #include <cstdio>
#define re register
#define rep(i, a, b) for(re int i = (a); i <= (b); ++ i)
#define Rep(i, a, b) for(re int i = (a); i < (b); ++ i)
const int N = 1e6 + 5;
const int INF = 0x3f3f3f3f;
int n, m, cnt, ans[N], c[N];
struct QUERY {
int l, r, k, pos, opt;
} q[N], q1[N], q2[N];
sta... |
abc132124afc414ea3215b75f0775fd64462074e | a116e1e9b69d62df70f17f90dcb154a4b6cecf23 | matinlotfali/NetworkSecurity | /Final/HILL.CPP | C++ | cpp | 3,059 | no_license | #ifdef QT_CORE_LIB
#include <iostream>
using namespace std;
#else
#include <iostream.h>
#endif
#include <COMMON.CPP>
int mod(int a, int b)
{
while(a<0)
a += b;
while(a>=b)
a -= b;
return a;
}
void Encrypt(int matrix[2][2], char ptext[100])
{
NormalizeString(ptext);
int i=0;... |
99036d9692b40faf98037043dfb0f2c4c77ec7f2 | 8cd1bd93bad2f62fd7855942fb62eadb9c78e71c | hkhamm/gauntmore | /src/Gold.cpp | C++ | cpp | 1,273 | no_license | #include "Gold.h"
#include "res.h"
#include "Game.h"
/**
* Constructor.
*/
Gold::Gold():_value(10) {
setType("gold");
}
/**
* Gets bounds of the unit Gold.
* @return: SDL_Rect _bounds which is the bounds of Gold.
*/
SDL_Rect Gold::getBounds() {
Vector2 unitPosition = getPosition();
_bounds.x = u... |
748543326bfdb544929321e76230453aac8bd618 | 59fec4e669338c809db55182d72659f1c223f3af | niuxu18/logTracker-old | /second/download/mutt/gumtree/mutt_repos_function_495_mutt-1.4.2.3.cpp | C++ | cpp | 1,346 | no_license | int mutt_alloc_color (int fg, int bg)
{
COLOR_LIST *p = ColorList;
int i;
#if defined (USE_SLANG_CURSES)
char fgc[SHORT_STRING], bgc[SHORT_STRING];
#endif
/* check to see if this color is already allocated to save space */
while (p)
{
if (p->fg == fg && p->bg == bg)
{
(p->count)++;
r... |
c2fa08e6990f57451328cf5cb34a4c65f26f659a | 363f0c7507f218f83eb67bac8b0a69bb15a4e79b | yesmancan/Tetris | /Publish/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/vm/Exception.cpp | C++ | cpp | 27,302 | no_license | #include "il2cpp-config.h"
#include "gc/WriteBarrier.h"
#include "os/MarshalStringAlloc.h"
#include "os/WindowsRuntime.h"
#include "metadata/GenericMetadata.h"
#include "vm/Array.h"
#include "vm/AssemblyName.h"
#include "vm/Class.h"
#include "vm/CCW.h"
#include "vm/Exception.h"
#include "vm/Object.h"
#include "vm/Refle... |
9004514524ade4058ab5ac8310e121682e7dcdfe | fc3d9bf45ca5aeda6d944a6ee835c47bda404262 | igchesnok/AHRUnrealEngine | /Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_RotationMultiplier.cpp | C++ | cpp | 2,083 | no_license | // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "AnimGraphPrivatePCH.h"
#include "AnimGraphNode_RotationMultiplier.h"
/////////////////////////////////////////////////////
// UAnimGraphNode_RotationMultiplier
#define LOCTEXT_NAMESPACE "A3Nodes"
UAnimGraphNode_RotationMultiplier::UAnimGraphNode_... |
8b2989ead96444f7db53c6c62f18d9c0aaa515dc | 3a851ab5891d06ba594945bc4e65a2ee0499c89a | shaguy3/OOP-project-3 | /election_cycle.cpp | C++ | cpp | 1,585 | no_license | #include "election_cycle.h"
ElectionCycle::ElectionCycle() :
date_of_election(Date()),
current_vote_amount(0),
residents(DynamicArray<Citizen*>()),
parties(DynamicArray<Party*>())
{}
ElectionCycle::ElectionCycle(Date& _date_of_election) :
date_of_election(_date_of_election),
current_vote_amoun... |
85616d8c64f24c6cf5f42683b94aa42859d5b6d5 | c6973e29c78b389b0d414e25f5ff04cf8c576189 | willisworley/naiveproxy | /src/net/quic/quic_http_stream.cc | C++ | cc | 27,172 | permissive | // Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/quic/quic_http_stream.h"
#include <set>
#include <utility>
#include "base/auto_reset.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_funct... |
c3a692b9d22c846c8c112fe45a76758fcf1ca32c | 774032b4f453338e13622f39672516540f0fa0cb | lewisgit/caffe-fixedpoint | /include/caffe/layers/lrn_layer.hpp | C++ | hpp | 3,368 | no_license | #ifndef CAFFE_LRN_LAYER_HPP_
#define CAFFE_LRN_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/layers/eltwise_layer.hpp"
#include "caffe/layers/pooling_layer.hpp"
#include "caffe/layers/power_layer.hpp"
#include "caffe/layers/split_l... |
111daa1bf7627d66f1a4b3eb2061179523e84ca8 | 5f5fa47deb36dbf70b1786f7390abac7d4894244 | leninkumar31/LENIN | /SEGMENT TREE/MULTQ3.cpp | C++ | cpp | 2,522 | no_license | //Author:leninkumar
//http://www.spoj.com/problems/MULTQ3/
//segment tree+lazy propagation
//accepted code
#include <bits/stdc++.h>
#define MAX 100005
using namespace std;
typedef struct node {
int a[3];
int val;
//for merging left and right nodes
void merge(node l, node r) {
for (int i = 0; i < 3; i++)
a[i] =... |
98d284991c913704daa1e45e2a2bda65115fbba0 | 1c0a381d20f9661c210b8853a09c1484e91fd56d | FFMG/myoddweb.piger | /myodd/boost/libs/multi_index/test/non_std_allocator.hpp | C++ | hpp | 4,053 | permissive | /* Used in Boost.MultiIndex tests.
*
* Copyright 2003-2015 Joaquin M Lopez Munoz.
* 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/multi_index for library home page.
*/
#ifn... |
93a395d5f8b7c6194abb2c3082e236e5c595047b | e98c74497dd8a3f15289e6a9bfa7676f66a2c82e | dmlloyd/Carla | /source/backend/plugin/CarlaPluginGui.cpp | C++ | cpp | 3,898 | no_license | /*
* Carla Plugin
* Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
*
* 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 2 of
* the License, or any later version.
*... |
6ce8971e850398819af9bcfcd16bf72f67cb92ae | 1c2b5eac23699cda798b9c95b47f02e5802f0315 | nghiank/sample_webkit_plugin | /main.cpp | C++ | cpp | 13,186 | no_license | /*
IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
consideration of your agreement to the following terms, and your use, installation,
modification or redistribution of this Apple software constitutes acceptance of these
terms. If you do not agree with these terms, ple... |
85546968de4335dc9098cb96cd9b6daa3e5df0c1 | 3bc19c032fe1b94a8c251c5725ea115762ea91cb | fujunwei/dldt | /inference-engine/src/vpu/common/src/utils/ie_helpers.cpp | C++ | cpp | 5,619 | permissive | // Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vpu/utils/ie_helpers.hpp>
#include <vpu/utils/extra.hpp>
#include <vpu/utils/error.hpp>
#include <vpu/utils/numeric.hpp>
#include <precision_utils.h>
#include <details/ie_exception.hpp>
#include <blob_transform.hpp>
#incl... |
9fbeb8489e601d0e2c587e12f9c5431e2ef0752d | cde3f2732fdfb42c93988115d8cae6e2c7d55c62 | profding-bh/C_Plus_Plus | /chapter4/sort/sorttwodemen.cpp | C++ | cpp | 856 | no_license | // 对二维数组的排序:
#include <iostream>
#include <algorithm>
#include <ctime>
using namespace std;
// 二维数组的排序
bool cmp(int *p,int *q)
{
cout<<*p <<"\t" <<*q<<endl;
if(p[0]==q[0])
{
if(p[1]==q[1])
{
return p[2]<q[2];
}
else
return p[1]<q[1];
}
else
... |
07e46169b17a934f3f9e2a917d4a903a65fe05eb | 0fc92160e03c5c1f63ba1dbd9fea269f0292c390 | SlimDX/slimdx | /source/direct3d10/EffectVariableDescription.cpp | C++ | cpp | 3,802 | permissive | #include "stdafx.h"
/*
* Copyright (c) 2007-2012 SlimDX Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, ... |
ad48edbd96ddf0b4b8ea24cdc788b214bc41bc32 | f7c121f9a55357826537b0243fe8c0e4e7f8a08d | Jaymzeh/SDL-Engine | /ComputingProject/ComputingProject/main.cpp | C++ | cpp | 267 | no_license | #include <iostream>
#include "game.h"
#if _DEBUG
#pragma comment(linker, "/subsystem:\"console\" /entry:\"WinMainCRTStartup\"")
#endif
int main(int argc, char* argv[]) {
Game* newGame = new Game();
newGame->init();
newGame->run();
delete newGame;
return 0;
} |
f43fc15e56d4486ced46c379c5728be6a09af559 | 048e27f78e69c4ac2e0c07ace1d7c847f9719deb | GSavvidis/Computational_Solid_State_Physics | /Askisi2_Trap1.cpp | C++ | cpp | 3,143 | no_license | #include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <fstream>
#include <stdlib.h>
#include <iterator>
#define seed 4324
using namespace std;
#ifdef seed
int main() {
int k; // ID of the walker
int t; // steps
double N_particles,relative_prob;
double i,j;
double c,zz;
double sum;
... |
00ed52b54c1ba8032a4c9f12b5cea3a4a38f7b56 | f725c76f2b2c2ea1b5d79463ec43b07cfb605ff6 | Park52/BaekJoon | /5052/5052.cpp | C++ | cpp | 901 | no_license | /***********************************************
첫 번째 시도: 시간 초과
-> 이중 포문으로 인한 문자열 탐색이 원인인 듯
두 번째 시도: sort -> 사전순으로 전화번호가 정렬
->
***********************************************/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main... |
c7adeac44cf7035ec789b2885b1d9bf9fe6bb159 | 4a34a4b540b55a60f33a74fa24fe00e556ad93cb | darkstalker31/04_BattleTank | /BattleTank/Source/BattleTank/TankTurret.cpp | C++ | cpp | 503 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "BattleTank.h"
#include "TankTurret.h"
void UTankTurret::Rotate(float RelativeSpeed)
{
RelativeSpeed = FMath::Clamp<float>(RelativeSpeed, -1, +1);
auto RotationChange = RelativeSpeed * MaxDegreesPerSecond * GetWorld()->DeltaTi... |
32c8aebc6c2ddc2911b236a9dee799e13803fa76 | 1a8c57ba95b56cc067238a08361e733de674bda1 | gandhy98/tareas-c- | /problema 10/probando.cpp | C++ | cpp | 205 | no_license | #include<string>
#include<iostream>
using namespace std;
int main()
{
std::string cadena = "hola mundo";
char buffer[100];
strcpy(buffer,cadena.c_str());
std::cout << buffer;
cin.get();
}
|
59c006cc1824ff28c354042b56caf3100d89c305 | adb65905c5112d7af2b38097dde04b58368cde1e | jmcomets/EUSDAB | /tests/hitboxes/main.cpp | C++ | cpp | 214 | no_license | #include "testhitbox.h"
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 500), "EUSDAB");
EUSDAB::Application * app = new EUSDAB::HitboxTest(window);
app->run();
delete app;
return 0;
}
|
ba24b982a6a8e671c1fcc4cdec43e5c25ff517ca | 83fcac74cfa5da97c29332a89fae164670cf9a45 | lecler-i/spider-client | /Utils/Unix/Includes/TCPServerUnix.hh | C++ | hh | 2,279 | no_license | /*
The MIT License(MIT)
Copyright (c) 2014 Cedric Sana (Ninetainedo - cedricsana@gmail.com)
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 witho... |
c9333fcb7eca0fc67374724beb9d827dcfe2718c | a6665c25c955fd9ca3d775dc8e3c7cb796c53dd1 | svsannidhay/competitive-programming | /dynamic_programming_practice/Learning/wine_shop_problem.cpp | C++ | cpp | 2,024 | no_license | /*
you are given the price of n wine bottles and cost of bottle
increases to year no * initial cost
you can sell bottle only from front and rear of the list
and in one year you can sell only one bottle per year
Find the maximum profit you can make
ex :-
year 1 :- 1 4 2 3 sell 1 pr... |
2d85cc9a2883d376c138dee552b5ed210a209668 | e24b5d18feab10c0ac620b76530c41aa2486c325 | NicoAN42/Magic_Soul_Cpp | /full.cpp | C++ | cpp | 104,361 | no_license | #include <bits/stdc++.h>
#include <iostream>
#include <string.h>
#include <windows.h>
#include <time.h>
#include <fstream>
#include <dos.h>
#include <conio.h>
#include <limits.h>
#include <stdlib.h>
#define delay Sleep
#define LINE 219
#define WALL '#'
#define DOOR 254
#define MIN_SIZE 5
using name... |
143b5ff9e1acfbc127465b01a0e3dc22ecb98696 | 04f5ed555eccf96e09c9d851bec8fb3eddef5833 | JHongKong/GitDaily | /源代码/WebServer-master/version_0.1/src/server.cpp | C++ | cpp | 5,308 | permissive | //
// Created by marvinle on 2019/2/1 7:34 PM.
//
#include "../include/server.h"
#include "../include/httpparse.h"
#include "../include/httpresponse.h"
#include <unistd.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <iostream>
#include <string>
using namespace serv... |
21c19ec1ca8b5ae9d3123a3388c1f2fd0e898eff | b28891d03544fa725fc474c6829623d9991b035a | connormcmonigle/autaxx-nn | /src/protocol/uai/go.hpp | C++ | hpp | 283 | permissive | #ifndef UAI_GO_HPP
#define UAI_GO_HPP
#include <libataxx/position.hpp>
#include <sstream>
namespace UAI {
// Stop searching
void stop();
// Start searching for a best move (threaded)
void go(const libataxx::Position &pos, std::stringstream &stream);
} // namespace UAI
#endif
|
d761353554cc7f5ec26b0648979bd5e72f4dc0ed | ae48faf3432685281c552754cc2fb3ff76213b2a | mevoroth/eternal-engine-core | /include/GamePools.hpp | C++ | hpp | 467 | no_license | #ifndef _GAME_POOLS_HPP_
#define _GAME_POOLS_HPP_
#include "Resources/Pool.hpp"
//#include "Core/TransformComponent.hpp"
//#include "Core/CameraComponent.hpp"
//#include "Core/LightComponent.hpp"
using namespace Eternal::Resources;
using namespace Eternal::Core;
//extern Pool<TransformComponent>* g_Transf... |
b221fe985091e3c06b1c2bbc6ec53dd123e4af8b | dc97377935635d5694fd252b9e11034215f3871e | jkauf8/TicTacToe | /game.cpp | C++ | cpp | 13,476 | no_license | //
// game.cpp
// hw1-pic10b
//
// Created by Justin Kaufman on 1/22/21.
//
#include "game.h"
#include <iostream>
using namespace std;
Game::Game(Person* playerOne, Person* playerTwo){
player1=playerOne;
player2=playerTwo;
}
bool Game::win(){
bool winning;
string current,current1,current2;
w... |
9eb7a7ae224cefd824f0fde8c527d0814de444e1 | dcdd56a430e29c9724d776366e0b73d914fc1e6f | pg30/Competitive-Submissions | /codeforces-submissions/Educational Codeforces Round 86 (Rated for Div. 2)/A. Road To Zero.cpp | C++ | cpp | 6,488 | no_license | /* ###########################
# Author : Pranay Garg #
# College : SGSITS #
###########################
*/
# include <bits/stdc++.h>
# include <ext/pb_ds/assoc_container.hpp>
# define ll long long int
# define ull unsigned long long int
... |
feb9a93918ce790d06a18a59caca83102a24f2a4 | 6072bddbff44d1e4e064c626b99c7e7fc2dc6857 | Uditgulati/CpCodes | /Codechef/Long Challenges/Nov 17/CLRL.cpp | C++ | cpp | 1,028 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int siz = 1e6 + 2;
const ll modu = 1e9 + 7;
const int inf = 1e9 + 10;
int main() {
int t;
scanf("%d", &t);
while(t--) {
int n, r;
scanf("%d%d", &n, &r);
int arr[n];
for(int i = 0; i < n; i++)
scanf("%d", &arr[i]);
if(n == 1) {
... |
dcf320ff1565c7f0fc1c3f88770f335099bc4975 | 584f05032bf61d4620d7b001ac83e6a222477c02 | jftaylor21/common-cpp-test | /code/stringrpc/chatserver/main.cpp | C++ | cpp | 706 | no_license | #include "ChatServer.h"
#include <utilities/utilities-time.h>
#include <utilities/utilities-screen.h>
bool running(false);
void exitCallback()
{
running = false;
}
int main()
{
Utilities::installSignalHandler(Utilities::Callback0(exitCallback));
std::string ip("127.0.0.1");
Utilities::Socket::localIP(ip);
... |
c8051540099a0f4abf2944fa56f7db06492bc1d9 | 0eede3443f24eb21d61191d5f7cb671f2a20042a | FerranIlla/ClothSimulation | /Cloth/src/physics.cpp | C++ | cpp | 11,901 | no_license | #include <imgui\imgui.h>
#include <imgui\imgui_impl_glfw_gl3.h>
#include <GL\glew.h>
#include <glm\gtc\type_ptr.hpp>
#include <glm\gtc\matrix_transform.hpp>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <time.h>
//Boolean variables allow to show/hide the primitives
bool renderSphere = tru... |
c335f0fb3551682bbcc0faaee7d7957bbe35bc5d | f77e09f0e9b4200e7fd5af2d2241427861d16499 | winmad/Winmad-s-raytracer-v1.0 | /Winmad-s-raytracer-v1.0/src/math/rng.cpp | C++ | cpp | 1,294 | no_license | #include "rng.h"
#define M 397
#define MATRIX_A 0x9908b0dfUL
#define UPPER_MASK 0x80000000UL
#define LOWER_MASK 0x7fffffffUL
void RNG::seed(uint32_t _seed) const
{
mt[0] = _seed & 0xffffffffUL;
for (mti = 1; mti < N; mti++)
{
mt[mti] = (1812433253UL * (mt[mti - 1] ^ (mt[mti - 1] >> 30)) + mti);
mt[mti] &= 0xff... |
d3dc66fa446f9b7d94cf6127e62d8fcf54977155 | 386b82c59b75a207a5fba2cfb928a198dd3be643 | ccdxc/logSurvey | /data/crawl/git/new_hunk_4337.cpp | C++ | cpp | 663 | no_license | return git_config_set_multivar(key, tmp->buf, "^$", 0);
}
static int parse_mirror_opt(const struct option *opt, const char *arg, int not)
{
unsigned *mirror = opt->value;
if (not)
*mirror = MIRROR_NONE;
else if (!arg)
*mirror = MIRROR_BOTH;
else if (!strcmp(arg, "fetch"))
*mirror = MIRROR_FETCH;
else if (!... |
dd0cb9077f197725c68fac28d1965a0f024d479b | 913689c7aa446a0d9c0f8ea532ae638dd21e4a82 | El-Dringo-Brannde/OSU-Classes | /CS-162-CSIntro2/DnDProto/Baba_Yaga.cpp | C++ | cpp | 2,422 | permissive | /*********************************************************************
** Program Filename: Baba_Yaha.cpp
** Author: Brandon Dring
** Date: 2/12/16
** Description: Does the attack, defense and constructor for Baba_Yaga
** Input: none
** Output: dependant on dice roll
*********************************************... |
88e5f0d3cbbb7dc5ab477c6a618761d0562e8bea | 11003f5132acdf7ddc1b2d5fb26e0f58f5a63c33 | kaveeken/linReg | /source/rwrite.cpp | C++ | cpp | 1,672 | no_license | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <exception>
#include <sstream>
#include "header.h"
std::vector<double> readClose()
{
std::string fname = "some_data";
std::ifstream ifs(fname);
if(!ifs.is_open())
throw std::runtime_error("unable to open some_data\n");
// ... |
d89fd069b4ff3c542fce4af09eee32e523b2ce5f | fe32c83fabf7ebc40c9c8a77c4674415e91d3f7d | vinayakvivek/CS475 | /toy-story/include/buzz_model.hpp | C++ | hpp | 17,207 | no_license | #ifndef BUZZ_HPP_
#define BUZZ_HPP_
#include "node.hpp"
#include "texture_util.hpp"
class BuzzHead : public Node {
void setInitialTransformation() {
glm::mat4 scale = glm::scale(glm::mat4(1.0f), 0.25f * glm::vec3(1.0f, 1.3, 1.0f));
glm::mat4 rotate = glm::rotate(glm::mat4(1.0f), (float)PI/2, glm::vec3(0.0f,... |
8c6348fbc22b9a867e9ca7c9c672ac448f2e7aa4 | 6830ee7f0ac45cde527e22a3f825b06e75a35893 | speedaemon/proxygen | /proxygen/lib/http/HTTPMessage.cpp | C++ | cpp | 28,193 | permissive | /*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#inc... |
bc3ade78dee13d6beb01f33779130eaf3afd66c9 | 4261e6c963fa620c1923124eb51efc5642636246 | colajam93/pomdog | /experimental/Pomdog.Experimental/Graphics/SpriteFontLoader.hpp | C++ | hpp | 388 | permissive | // Copyright (c) 2013-2016 mogemimi. Distributed under the MIT license.
#pragma once
#include "SpriteFont.hpp"
#include "Pomdog/Content/AssetManager.hpp"
#include <memory>
namespace Pomdog {
class AssetManager;
class SpriteFontLoader final {
public:
static std::shared_ptr<SpriteFont> Load(
AssetManager... |
ed8a744be06909b90d04961f5bc72577634adb76 | a6124231cfa6f8ba8862efa4636e923dafd10b38 | generalwave/openmpt | /soundlib/MIDIMacros.cpp | C++ | cpp | 11,489 | permissive | /*
* MIDIMacros.cpp
* --------------
* Purpose: Helper functions / classes for MIDI Macro functionality.
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#include "stdafx.h"
#include "../soundlib/MIDIEvents.h"
#in... |
d29a00efe1184d1627692aaba0b108370c9d1e2e | 4303f596136f4420a8cd2a15e831e5f48cfee03a | wwllww/LiveStream_MultiIntance | /PipeCapture/V1.1/BitmapImage.cpp | C++ | cpp | 2,266 | no_license | #include "BitmapImage.h"
BitmapImage::BitmapImage()
{
changeMonitor = NULL;
lpGifData = NULL;
texture = NULL;
}
BitmapImage::~BitmapImage()
{
if(lpGifData)
Free(lpGifData);
EnableFileMonitor(false);
delete texture;
}
//----------------------------------------------------------------------------
... |
c15eeee24b642cbb8a8582de3fd3bb74461d9530 | c0613228f46dca869a958a52c37d178beecfbcd4 | dushulife/LibUIDK | /LibUIDK/SkinProgressCtrl.cpp | C++ | cpp | 20,185 | permissive | // SkinProgressCtrl.cpp : implementation file
//
#include "stdafx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
struct PROGRESSMEMBER
{
PROGRESSMEMBER()
{
m_bIsShowText = TRUE;
m_sizeThumb.cx = m_sizeThumb.cy = 0;
m_ptResizeThumb.x = m_p... |
a691bf7f4ec6403f43b66054dacb673082a648df | af5eedb1002ce9c83db5d539f089d5ebd346f58e | mjannat/Online-Judge-Problems-Solution-in-Cpp | /C. Shahhoud Training Hussain.cpp | C++ | cpp | 292 | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll test;
cin >> test;
while(test--)
{
ll k, p, n;
cin >> k >> p >> n;
if(k > p )cout << (k * n) - (p * n) << endl;
else cout << 0 << endl;
}
}
|
869b876cc5bcebf35d2333a60dff8e591648946d | 549a4aeeb83cf225bf110b5e4fa363ee528f7873 | SOFTK2765/PS | /BOJ/9938.cpp | C++ | cpp | 1,277 | no_license | #include <bits/stdc++.h>
using namespace std;
class DisjointSet
{
public:
vector<int> parent, rank, bottle, bsize;
DisjointSet(int n) : parent(n), rank(n, 1), bottle(n), bsize(n, 1)
{
for(int i=0;i<n;i++)
parent[i] = i;
}
int find(int u)
{
if(u==parent[u]) return u;... |
32c5e8e2c0999ff3ec0dc37564c8c03e33d130e4 | a6472fa57bfdc18961b1051ec1879ae5239395f4 | samkenhuang/Algorithm | /leetcode/question-base/updateMatrix.cpp | C++ | cpp | 1,613 | no_license | #include "../util/stl.h"
class Solution {
private:
static constexpr int dirs[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) {
int m = matrix.size(), n = matrix[0].size();
vector<vector<int>> dist(m, vector<int>(n));
vec... |
b847846189586f6baf93e15d73b9633dcfc9213f | b40de939068a9bbf133ed55e2715e700946ca946 | TencentCloud/tencentcloud-sdk-cpp | /pts/src/v20210728/model/UpdateScenarioResponse.cpp | C++ | cpp | 3,039 | permissive | /*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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
... |
ab1223bab641ed3e9af413a55f7e20246f373483 | dc7c6a91a1a779ae918a55d26c74e47c3996a8bd | qt/qtbase | /src/3rdparty/tinycbor/tests/encoder/data.cpp | C++ | cpp | 17,402 | permissive | /****************************************************************************
**
** Copyright (C) 2021 Intel Corporation
**
** 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 restrict... |
1b4b95973b9c1ec61b69ae74ffeed5ac7e490906 | 8b1fb9d092bfd58504a3b8a9c438d5b9b2bbf36e | xmnboy/samples | /tbb/parallel_for/tachyon/src/objbound.cpp | C++ | cpp | 9,858 | permissive | /*
==============================================================
SAMPLE SOURCE CODE - SUBJECT TO THE TERMS OF SAMPLE CODE LICENSE AGREEMENT,
http://software.intel.com/en-us/articles/intel-sample-source-code-license-agreement/
Copyright 2016 Intel Corporation
THIS FILE IS PROVIDED "AS IS"... |
0cc87250e4c18790717febee5163f249ac1d546c | db3328a59f930fa467c01d63dd8f417d6b5e3b68 | hshun123/Program_Design_and_Development | /project/drivers/regression_driver.cc | C++ | cc | 1,107 | no_license | #include <ctime>
#include <iostream>
#include <fstream>
#include <random>
#include <string>
#include "r_local_simulator.h"
int main() {
int rounds = 50; //Number of rounds of generation to simulate in test
srand((long)1); //Seed the random number generator with the same seed every time!
rLocalSimulator my_s... |
79a849f5c88358bc0cac76abb536c5b8e34c10f9 | f917ca6011072e1767149edb230ffb6519e9d9c2 | oturan-boga/Windows2000 | /private/shell/ext/settings/utils.cpp | C++ | cpp | 4,662 | no_license | ///////////////////////////////////////////////////////////////////////////////
/* File: utils.cpp
Description: Contains any general utility functions applicable to the
dskquota project.
Revision History:
Date Description Programmer
... |
b1ae1916f4748b7d6097b2c3eb315b5c648b856b | b2fd95688325cd588452e7afea09d6a9edcf291b | ivanreid/cmssw | /RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc | C++ | cc | 12,874 | permissive | /** \class EgammaHLTGsfTrackVarProducer
*
* \author Roberto Covarelli (CERN)
*
* $Id: EgammaHLTGsfTrackVarProducer.cc,v 1.1 2012/01/23 12:56:38 sharper Exp $
*
*/
//this class is designed to calculate dEtaIn,dPhiIn gsf track - supercluster pairs
//it can take as input std::vector<Electron> which the gsf track-... |
e439de74965f0317d1949917d0566d5c6dc09df8 | 896ebacf3c1ba35f244af4ca465ded215c4e7c34 | asaggi/RTIDDS | /ChatApp/impl_cpp/chat.cxx | C++ | cxx | 6,569 | no_license |
/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from chat.idl using "rtiddsgen".
The rtiddsgen tool is part of the RTI Connext distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the RTI Connext manual.
*/
#ifndef NDDS_STANDALONE_TYPE
#ifndef ndds... |
882de9983086a4ebb0daa41f70e3eb75770a4338 | ab4fbcb90368cf28b16a1b6c76dbeb18e9d1ac78 | iyht/Jacobian-Based-Continuum-Robot-Control | /main.cpp | C++ | cpp | 5,790 | no_license | //includes
#include <visualizer.h>
#include <tdcr_model.h>
#include <ctcr_model.h>
#include <mainloop.h>
//stl
#include <iostream>
#include <cmath>
#include <array>
//vtk
#include <vtkRenderWindowInteractor.h>
#include <vtkCommand.h>
#include <vtkInteractorStyleTrackballCamera.h>
//Eigen
#include <Eigen/Dense>
int... |
b6bff3bade852ed65e7d05cb2c2a90d6f3832854 | 2d830d5d150756711d1fa446c1d951eb75d0de88 | nevilparmar11/CompetitiveProgramming | /USACO/Contests/1819_1P/Gathering.cpp | C++ | cpp | 1,896 | no_license | #include <bits/stdc++.h>
using namespace std;
const int mxN=1e5;
int n, m, ui, vi, anc[mxN][17], dt, ds[mxN], de[mxN], gu[mxN], gd[mxN+1], ai, bi;
vector<int> adj1[mxN], adj2[mxN];
bool vis[mxN], act[mxN], fk, a1[mxN];
void dfs1(int u=0, int p=-1) {
ds[u]=dt++;
anc[u][0]=p==-1?-1:p;
for(int i=1; i<17; ++i)
anc[u... |
2bc50717b65f8730d4e6fe49a145d42341994093 | 388a74421bc2b0be9c116a8b6f5d040413de536d | dealenx/parallel-labs | /zad_1_2/sequential.cpp | C++ | cpp | 1,626 | no_license | #include "mpi.h"
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include "helper.h"
using namespace std;
void printMatrix(double **matrix, int n)
{
cout << endl;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cout << setw(14) << matrix[i][j];
}... |
805551581747edd0f82ac29d3fd9eb7d74ad7330 | 388f89becd94c7e511e372edf8d51a474c23e3c1 | salo50/redspace | /src/chainparamsbase.cpp | C++ | cpp | 2,872 | permissive | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2016-2017 The PIVX Developers
//Copyright (c) 2019 The RedSpace developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
e07a149b87c3510a39d5cf8f5c120160dc333602 | 6f1c7c8bcc3ddf1d98c7a38df9f1adf748664a15 | JTHEN-DEV/CompetitiveProgramming | /Csacademy/balancednumber.cpp | C++ | cpp | 298 | no_license | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
map<char, int> m;
for (char a : s){
m[a]++;
}
int x = m['0'];
for (auto y : m){
if (y.second != x){
return 0;
}
}
return 1;
}
|
4be9abed097e304e3ef9600dddc351109789e904 | 8ee389d948856f79129e25e88d2e986515e8c6f6 | Tomistong/UvaProblemSolution | /336.cpp | C++ | cpp | 1,799 | no_license | #include<bits/stdc++.h>
#define pii map<int,int>
using namespace std;
vector<int>edge[100];
pii ::iterator it;
pii ::iterator p;
pii visited;
pii level;
void bfs(int sc){
queue<int>q;
visited[sc]=1;
level[sc]=0;
q.push(sc);
while(!q.empty()){
int u=q.front();
q.pop();
for(int i=0;i<edge[u].size();i++){
... |
969dffdb87d452aeeb67829a69ced325b83e94f2 | b3317116dd35cab488977c45ef30d82a532afeb6 | minhaz044/Student-Database-With-C | /Demo Of Student DataBase.cpp | C++ | cpp | 4,209 | no_license | #include<stdio.h>
int bubble(int*,int);
void filewrite();
void avgmarks();
void fileprint();
void filesort();
void rollin();
/*********************** SORTING FUNCTION ***************************/
int bubble(int x[],int n)
{
int hold,j,pass,i,switched = 1;
for(pass = 0; pass < n-1 && switched == 1... |
dbf16249f678f821af96a8792b3f2b190b8bb7df | d98259b9faa420e8e5d649f421d8f90d632768b0 | azbyn/oop | /Chess/Chess/chess/Bot.cpp | C++ | cpp | 4,122 | no_license | #include "Bot.h"
#include "BoardState.h"
#include "../stockfish/endgame.h"
#include "../stockfish/thread.h"
#include "../stockfish/uci.h"
#include <sstream>
// FEN string of the initial position, normal chess
constexpr static const char* StartFEN =
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
... |
0f022c91aae3f6cd5f648a4c7e210426fc42f5a5 | 517658e38a469de35d116def273cfba1d181959f | udayan14/Competitive_Coding | /codechef/cook119/percapta.cpp | C++ | cpp | 2,306 | permissive | #include<iostream>
#include<vector>
#include<queue>
#include<cstring>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--){
int n,m;
cin >> n >> m;
vector<int> adj[n+1];
for(int i=1 ; i<=n ; i++)
... |
a06d173f4f554f2596c632b103d3a505cfc8e3f9 | 66c1556b24896841ef3564634f1232687e400d38 | radixx-skip/RayTracer | /RayTracer/World.cpp | C++ | cpp | 907 | no_license | #include "World.h"
#include "ObjectFactory.h"
#include <json.hpp>
#include <fstream>
#include <string>
World& World::instance()
{
static World world_instance;
return world_instance;
}
World::~World()
{
for each (ObjBase* obj in m_objectList)
{
delete obj;
}
}
void World::add(const char* file)
{
std::ifstrea... |
2e698b8528ba651a2919862d91f6c84eb39353db | 7adb4cf8d19019dcefbf31e776346754d9651a06 | jobryan/bispectrum_calculation | /cpp_code/test/test_mpi.cpp | C++ | cpp | 2,353 | no_license | /*
test_mpi.cpp
Created on May 29, 2014
Updated on June 3, 2014
@author: Jon O'Bryan
@contact: jobryan@uci.edu
@summary: Testing code for C++
@command: Needs to be made then run:
mpic++ test_mpi.cpp -o test_mpi
then run (e.g., with 4 processors)
mpi... |
852d22792309a86ad933f5d1eb539a7386b84ff3 | 3f1a8c3bc1785703328df9a9b856a35a7801d45c | ystk/debian-fluxbox | /src/FbTk/Observer.hh | C++ | hh | 1,410 | permissive | // Observer.hh for FbTk
// Copyright (c) 2002 Henrik Kinnunen (fluxgen at fluxbox dot org)
//
// 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 limitat... |
08fb49d0a1d262ae0f72c30ef4034d62d4303107 | 8fd2af1a4118ab2521c53a970b77fc67162afffb | owensgroup/dcgn | /infrastructure/src/MPIWorker.cpp | C++ | cpp | 13,493 | no_license | #define MPICX_SKIP_MPICXX
#include <mpi.h>
#include <dcgn/MPIWorker.h>
#include <dcgn/BarrierRequest.h>
#include <dcgn/BroadcastRequest.h>
#include <dcgn/Profiler.h>
#include <dcgn/RecvRequest.h>
#include <dcgn/SendRequest.h>
#include <dcgn/SendRecvRequest.h>
#include <dcgn/ShutdownRequest.h>
#include <dcgn/Thread.h>
#... |
dc6e213d91b79680cc18fe4557aad20f79484543 | bbe39fb791385d1e41afd71e8e3036c557fbcd87 | FDecaYed/pytorch | /aten/src/ATen/TensorImpl.cpp | C++ | cpp | 3,656 | permissive | #include <ATen/TensorImpl.h>
#include "ATen/Context.h"
#include <ATen/Tensor.h>
#include <ATen/core/optional.h>
#include <ATen/Context.h>
#include <ATen/core/Backend.h>
#include <ATen/detail/VariableHooksInterface.h>
#include <TH/THTensor.hpp>
namespace at {
Type& TensorImpl::type() const {
// Select backend fro... |
b0e80ce702dd5685bef99858f6933b75644461ad | af38d97e9023b89524061de3eacb1fb19c8b2803 | Nalin007/test2 | /lab56.cpp | C++ | cpp | 314 | no_license | #include<iostream>
using namespace std;
void find_max(int vals[5]);
void main()
{
int nums[5] = {2,18,1,27,16};
find_max(nums);
}
void find_max(int vals[5])
{
int max = vals[0];
for (int i = 1; i < 5 ; i++)
if(max < vals[i])
max = vals[i];
cout << "The maximum value is " << max << endl;
} |
11907f534352be752b3d0001d46f4e5f0d490fba | 2d8e4e04e260cf6f8c0a09e0dc83ffa9e4cd0e03 | mrelich/IceBlock | /src/LookUpTable.cc | C++ | cc | 14,683 | no_license | #include "LookUpTable.hh"
#include "Constants.hh"
#include <fstream>
//--------------------------------------------------//
// Constructor
//--------------------------------------------------//
LookUpTable::LookUpTable(std::string filename)
{
std::ifstream lookupfile;
lookupfile.open(filename.c_str(), std::ios::in)... |
40706d91c8dfcf63d16628953d54775ea0a205b5 | fa5a48c6144a3ca583e53843a18a799a4409be77 | tjfulle/lgrtk | /src/plato/Kinematics.hpp | C++ | hpp | 2,951 | permissive | #ifndef KINEMATICS_HPP
#define KINEMATICS_HPP
#include "plato/SimplexMechanics.hpp"
#include "plato/PlatoStaticsTypes.hpp"
namespace Plato
{
/******************************************************************************/
/*! Two-field Mechanical kinematics functor.
Given a gradient matrix and state array, comp... |
4ddf4f0d40c9360d992557c75f2df08a4af8e91f | 311bdcbfa8d41fc48825a85b9c40c8aaf6717c86 | zacario-li/tvm | /src/codegen/codegen_metal.cc | C++ | cc | 8,801 | permissive | /*
* 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"); you ... |
c428765c7b9a41c3956b60bbec854adf8f72ad9c | f30ad6de2d4a69886655b5f377daa7b8def0fc23 | cualquiercosa327/Game-1 | /Game/hud/screenhudrender.cpp | C++ | cpp | 1,098 | no_license | #include "screenhudrender.h"
#include <MyGL/IScene>
#include <MyGL/IRender>
#include <MyGL/IData>
#include <MyGL/IRenderState>
#include <MyGL/IShader>
#include <MyGL/IUniform4f>
using namespace MyGL;
ScreenHudRender::ScreenHudRender(MyGL::IScene &s):scene(s){
sh = 0;
}
void ScreenHudRender::initGl(){
s... |
ec805f372c766f286fd777dad198f9b70c29ac2e | fee710b790a8431949f67b5e52f54e7029f3374e | liushaopu8/Elastos.OS | /Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/content/CContentProviderResult.cpp | C++ | cpp | 3,807 | permissive | //=========================================================================
// Copyright (C) 2012 The Elastos 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
//
// ... |
e92a254f92981bfbbc96424d897cec9945de02ab | 1e595abc0b2c45a8fcc5166a827cff4cf94bc1c5 | NPuhlmann/SPI_P1 | /modulo.cpp | C++ | cpp | 1,837 | permissive | #include <iostream>
#include <stdio.h>
#include <cmath>
#include <tuple>
using namespace std;
void findFactors(long long n)
{
long long x = 0;
while (true)
{
x++;
long long y = 0;
while (y <= x)
{
y++;
if (n == pow(x, 2) - pow(y, 2))
{
... |
3cbb023105b83845231717686e83b98d46d8f233 | 82132f693607e55ec70d45e660e60d09facb3e61 | Kushwaha-abhay/Placement-Preparation | /DSA/LeetCode/Tree/Path In Zigzag Labelled Binary Tree.cpp | C++ | cpp | 536 | no_license | class Solution
{
public:
vector<int> pathInZigZagTree(int label)
{
double lvl = floor(log2(label)) + 1;
vector<int> res;
res.push_back(label);
for(int i=lvl ; lvl>=2 ; lvl--)
{
int val=pow(2,... |
b39614eda36419cb9d51c5b91696c0ea92ab029b | eb6e41a57e8d59efc86ef59886479a0da0826b65 | mikezackles/text | /include/boost/text/data/bs_Cyrl.hpp | C++ | hpp | 379 | permissive | // Warning! This file is autogenerated.
#ifndef BOOST_TEXT_DATA_BS_CYRL_HPP
#define BOOST_TEXT_DATA_BS_CYRL_HPP
#include <boost/text/string_view.hpp>
namespace boost { namespace text { namespace data { namespace bs_Cyrl {
inline string_view standard_collation_tailoring()
{
return string_view(
u8R"(
[reorder C... |
034cbb8d55fb6d40db3d10c5c2c14603f97d94b1 | 42082e14de1aee41269dbe1f7ca4d7ff9569228f | MateuszSnamina/onerut | /onerut_normal_operator/src/operator_fock.cpp | C++ | cpp | 5,246 | no_license | #include<cassert>
#include<onerut_normal_operator/utility_fock.hpp>
#include<onerut_normal_operator/operator_fock.hpp>
namespace {
bool _symm_factor(const std::vector<bool> decoded, uint32_t index_lo, uint32_t index_up) {
const auto symm_factor_power = std::count(
begin(decoded) + index_lo... |
14da1a62d959020d6b1243ee0aa9362638463b28 | e5c76a14845f5c340d062959e5563fe6cfce4f11 | divyanshmanocha/Mips_CPU | /src/dm2515/mips_cpu_basic_definitions.hpp | C++ | hpp | 2,879 | no_license | #ifndef COMPARCHMIPS_MIPS_CPU_BASIC_DEFINITIONS_HPP
#define COMPARCHMIPS_MIPS_CPU_BASIC_DEFINITIONS_HPP
#define TYPE 0
//Different types
#define R_TYPE 0
#define I_TYPE 1
#define J_TYPE 2
#define OPCODE 1
//R_INFORMATION DEFINTIONS
#define RS 2
#define RD 3
#define RT 4
#define SHIFT 5
#define FUNCTION 6
//I_INFORMATI... |
c3f65a1570ab001b0c54bac03243786adc2bdbfd | fe3b011f44ab60adb3bbb1270006fb302e2fb4dd | ngnevan/ydk-cpp | /openconfig/ydk/models/openconfig/bundle_info.hpp | C++ | hpp | 1,194 | permissive | /// YANG Development Kit
// Copyright 2016 Cisco Systems. All rights reserved
//
////////////////////////////////////////////////////////////////
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional inf... |
c84291a1f48e5909b7aca553ac0986c8ef668370 | 07b9b23c9b564d8db0d2694131cf1376350f0236 | ChristinaAndrinopoyloy/Cpp | /project_1/HYPERCUBE/LSH_part.cpp | C++ | cpp | 1,060 | no_license | #include "LSH_part.h"
/*generate an h function (Euklidean way)*/
int generate_Euclidean_h_function(dataset &mydata, int order)
{
int w = 4;
float t;
vector<float> v(mydata.get_point_dimension());
int h;
t = rand() % 4; ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.