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 |
|---|---|---|---|---|---|---|---|---|
b0f4d6a1bdb91793fc70d81bf548e869d979cb1e | 659442300f748ba5a5bfb6f20e67d5b5a43223e2 | beam2d/pficommon | /src/visualization/ppm_test.cpp | C++ | cpp | 5,108 | no_license | // Copyright (c)2008-2011, Preferred Infrastructure Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// ... |
1318d5d4df777a5282e78e9c2d7551892e09864c | 21bf3f5f77268272b9d036e77bf9db953614bde9 | x1aoo/openvino | /inference-engine/src/gna_plugin/backend/am_intel_dnn.cpp | C++ | cpp | 113,293 | permissive | // Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <cstdint>
#include <vector>
#include <cmath>
#include <set>
#include <string>
#include <algorithm>
#include <map>
#if defined __INTEL_COMPILER || defined _MSC_VER
#include <malloc.h>
#else
#include <mm_malloc.h>
#endif
#i... |
881289e7af800c80e0b5998f8f24e59a68a40bd6 | cf621e9c48be607443ebc25d2c5944c8ad1b9c58 | Kawser-nerd/CLCDSA | /Source Codes/AtCoder/abc032/D/1270996.cpp | C++ | cpp | 5,064 | no_license | #include <cstdio>
#include <vector>
#include <algorithm>
typedef long long int ll;
//const double th0 = 0;
//const double th1 = 1e+6;
struct state {
ll aw;
ll av;
state(ll aw=0, ll av=0): aw(aw), av(av) {}
};
struct item {
int w;
int v;
double d;
item(int w, int v): w(w), v(v), d((... |
64e8981a791edcb8c84ca93cdca3b20b82ab6cb4 | 3a8e52dafcaebf3a41d20e0cbe65c63782eba07e | RBJH/SWExpertAcademy | /D3/5162. 두가지 빵의 딜레마.cpp | C++ | cpp | 374 | no_license | #include <iostream>
using namespace std;
int T, A, B, C;
int result;
int main() {
cin >> T;
for (int t = 1; t <= T; t++) {
cin >> A >> B >> C;
result = 0;
int sum = 0;
for (int i = C / A; i >= 0; i--) {
sum = i + (C - A * i) / B;
if (result < sum) result = sum;
}
cout <<... |
682977d640cf284f3d350b96e01f150f3cd82c19 | 8400699a0652e17826844f4f37724e536a6bf3c5 | Jeremy517/xenia | /src/xenia/kernel/xam/xam_user.cc | C++ | cc | 18,301 | no_license | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. ... |
1ee3911e770b39f5707b8613945c00f0ad1e5df5 | 15d17963ee3c3547e18d1b955ab1470336791182 | BOJ-expedition/Challenges-of-the-week | /2021W08/fienestar/boj_1_4375.cpp | C++ | cpp | 322 | no_license | /*
1
https://www.acmicpc.net/problem/4375
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
size_t N;
while(cin >> N){
unsigned long long v = 1;
size_t c = 1;
while((v%=N) != 0){
v = v * 10 + 1;
++c;
}
cout << c << "\n";
}... |
1423c2b09ac05dc8a50ae6a979a27342a90c1536 | 32e5a62ce7b77258992e56f7181600c651f2a3ef | autoscatto/retroshare | /branches/v0.5-FileSharingPermissions/libbitdht/src/bitdht/bdnode.cc | C++ | cc | 54,479 | no_license | /*
* bitdht/bdnode.cc
*
* BitDHT: An Flexible DHT library.
*
* Copyright 2010-2011 by Robert Fernie
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 3 as published by the Free Software Foundation.
*
* This librar... |
129e46bd7081ebb8914db02ff360193921f9303e | 81ed520aa03419a4dcb4d98ded53904207c47d6f | Yeluorag/ACM-ICPC-Code-Library | /CQU Summer/7-27 暴力 II/S - String.cpp | C++ | cpp | 434 | no_license | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 100005;
int mx, n, k;
char s[maxn];
int main(){
freopen("/Users/apple/input.txt", "r", stdin);
... |
834513d1df2650212deed8b271a907f50398938d | 98abe1d465b8fc5a3a72edbd4367579e64555e1d | ddjddd/Algorithm-Study | /Backjoon_Onlie_Judge/1000/1005.cpp | C++ | cpp | 1,112 | no_license | #include <iostream>
using namespace std;
int n;
int dp[1001], arr[1001];
bool tab[1001][1001];
int reverseDFS(int end) {
if (dp[end] != -1) {
return dp[end];
}
int m = 0, res = 0, ret;
for (int i = 1; i <= n; i++) {
if (tab[i][end]) {
res = reverseDFS(i);
m = m... |
9e995372be3ed508a54033a14dd2b20d10dcd725 | e38aace24e9c4cbf10e9444e58215286d78fd46d | Quaker762/serenity | /Userland/Libraries/LibCore/Group.cpp | C++ | cpp | 3,196 | permissive | /*
* Copyright (c) 2022, Kenneth Myhra <kennethmyhra@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/CharacterTypes.h>
#include <AK/ScopeGuard.h>
#include <LibCore/Group.h>
#include <LibCore/System.h>
namespace Core {
#if !defined(AK_OS_BSD_GENERIC) && !defined(AK_OS_ANDROID)
ErrorOr<vo... |
0be35689543f7a0b9018eeb3977ed873ab44ccbc | a46a4e7ab8e6cd5599b51ca5d3c339b9c6a90ba8 | sea5727/odbctemplate | /odbc_inc.hpp | C++ | hpp | 354 | no_license | #pragma once
#include <memory>
#include <string>
#include <iostream>
#include <tuple>
#include <sql.h>
#include <sqlext.h>
#include <functional>
#include <typeinfo>
#include <string.h>
#include <vector>
#include <exception>
#include <sstream>
#include <utility>
#include <sqlext.h>
#include <thread>
#include <chrono>
... |
505214e24e4cf2562de28c51d46be8929b391378 | ed6df4e72c47efd0bb0f04572be0f8a8bfdbfb4a | akashtalole/cpp-netlib | /boost/network/protocol/http/message/modifiers/major_version.hpp | C++ | hpp | 1,002 | permissive | #ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_MAJOR_VERSION_HPP_20101120
#define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_MAJOR_VERSION_HPP_20101120
// Copyright 2010 Dean Michael Berris.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// ... |
c69bd490778be496ae0589178b08b8c6eaa924e9 | b4a39872b22fdbc177f0c4d875c31d84ffedf490 | ShanGlor/RC-Tank | /lib/ArduinoRCLib/Expo.cpp | C++ | cpp | 2,685 | permissive | /* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** Expo.cpp
** Exponential functionality
**
** Author: Daniel va... |
282fb607c9674e38d9d3f4f64c2fb17eecb7c654 | b456176426cde3f794c3366293fcb1741a1c41d5 | joeri/e | /src/eIpcServer.cpp | C++ | cpp | 3,868 | no_license | /*******************************************************************************
*
* Copyright (C) 2009, Alexander Stigsen, e-texteditor.com
*
* This software is licensed under the Open Company License as described
* in the file license.txt, which you should have received as part of this
* distribution. The terms... |
ac6741e73c9d5aa80202fea366f509c4402f1df4 | 8c48617042961437571d4f228ce16e65643cee06 | jkmiro95/dino | /SFML_GAME/TextureManager.hpp | C++ | hpp | 397 | no_license | //
// TextureManager.hpp
// SFML_GAME
//
// Created by Jakub Mirocha on 08.06.2018.
// Copyright © 2018 Jakub Mirocha. All rights reserved.
//
#ifndef TextureManager_hpp
#define TextureManager_hpp
#include <SFML/Graphics.hpp>
class TextureManager {
public:
TextureManager();
~TextureManager();
sf::Text... |
9f63ac6f8d86d7e1135bca5d07f122dc81f96be2 | 82e4a16ac82303d18a91e29a7eab401c00c8d039 | Jetcodery/SegModel | /src/caffe/layers/data/image_class_data_layer.cpp | C++ | cpp | 4,571 | no_license | #include <fstream> // NOLINT(readability/streams)
#include <iostream> // NOLINT(readability/streams)
#include <string>
#include <utility>
#include <vector>
#include <algorithm>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgui/hig... |
16f96689c4df4c6a43d285977285db8698cc7a2d | 61dae497f8a793ca47f3efdc6bb924de35d04d5f | Mannilie/ZombieSurvival | /source/CameraManager.cpp | C++ | cpp | 3,494 | no_license | #include "CameraManager.h"
CameraManager::CameraManager(){}
CameraManager::~CameraManager(){}
CameraManager::CameraManager(Point2D a_oVelocity, Point2D a_oPosition)
{
m_oVelocity = a_oVelocity; //Sets the camera's velocity to the one passed into the class
m_oPosition = a_oPosition; //Sets the camera's position to t... |
1daf752eeae8a644a09552a670f0fd9c3587c14b | ae31857108795ee60f1d063abbed799a5a6f64ca | CreishiDaiamon/Practicas-c- | /Bisiesto.cpp | C++ | cpp | 430 | no_license | #include <iostream>
using namespace std;
//Diseñe un programa que determine si un año es bisiesto
int year;
int main (){
cout<< "Ingrese YEAR para determinar si es bisiesto o no\n\n";
cin>> year;
if ( (year %4 == 0 && year %100 != 0) || year % 400 == 0 )
{
cout<<"el year "<< year << " es b... |
2d661cea0fd942ba9e9282b60c258d5928b8ea78 | df651db1470138ae4a270b9dd42cf11e37d12763 | sakshamtaneja21/JU-notes | /CRT code/practice sheet/Constructor.cpp | C++ | cpp | 915 | no_license | #include<iostream>
using namespace std;
class Sample
{
private:
int x, y, z;
public:
Sample() // default constructor
{
x = y = z = 0;
}
Sample(int x) // one argumented constructor
{
this->x = x;
y = 0;
z = 0;
}
Sample(int x, int y) // two argumented constructor
{
this->x = x;
this-... |
a2dab733eb3a1734d1053873215ada4e471d643e | 7427379de5d17fed7301c3e959b9e18b786a05a8 | maxime-tournier/pouf | /linearsolver/jacobi.cpp | C++ | cpp | 11,308 | no_license | #include "jacobi.h"
#include <sofa/core/ObjectFactory.h>
#include <Compliant/utils/scoped.h>
#include <Compliant/utils/edit.h>
#include <Compliant/utils/schur.h>
#include <Compliant/utils/nan.h>
#include <tool/lcp.h>
#include <thread/pool.h>
#include <Compliant/constraint/CoulombConstraint.h>
#include <Compliant/co... |
ca5d0bad34e1a008cfff0c09272f2d863516fc86 | 46affe4b12edeae68d23b2e3862391896fc3647f | takuya-araki/vstl | /src/vstl/seq/core/upper_bound.hpp | C++ | hpp | 5,482 | permissive | #ifndef UPPER_BOUND_HPP
#define UPPER_BOUND_HPP
#include <vector>
#include <cstddef>
#if defined(_SX) || defined(__ve__)
#define UPPER_BOUND_VLEN 2048 // not vlen, but better than 256
#else
#define UPPER_BOUND_VLEN 4
#endif
namespace vstl {
namespace seq {
// https://stackoverflow.com/questions/6443569/implementati... |
4e8b3c3744a87372394bb1e48bf586d5434be293 | 73feb6f2068e334b165bf973cb000add934ca01e | 1664988610/- | /小游戏/1.cpp | C++ | cpp | 31,018 | no_license | #include "1.h"
#include <string>
#include <vector>
using namespace std;
const int client_x = 640;
const int client_y = 640;
int _fun_x = 400;
int _fun_y = 600;
int fun_x, fun_y;
const int map_nx = 10;
const int map_ny = 10;
const int block_x = 64;
const int block_y = 64;
const int move = 10;
const double PI = 3.14159... |
eceb66cbf58e26e4172ce947b5fe5059770ed271 | 08b49c68d4afc99aab00b5968211024a1485e3d7 | nxg-crypto/nxg | /src/qt/addresstablemodel.cpp | C++ | cpp | 16,120 | permissive | // Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "addresstablemodel.h"
... |
708f0b65d99668e06b97ba9dcfe8d8c062dde249 | 7644ad92cd7996fe2efcf6bf2e89a378e28d7a59 | cicelprg/VTK | /Charts/Core/vtkPiecewiseFunctionItem.cxx | C++ | cxx | 4,460 | permissive | /*=========================================================================
Program: Visualization Toolkit
Module: vtkPiecewiseFunctionItem.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This ... |
fdfc930ac901976d274c88ef995159d837b34235 | 2e9c8ce7a2e6396f0bb94f9233bc49e3216f881a | NickPak/oatpp | /src/oatpp/web/mime/multipart/Reader.hpp | C++ | hpp | 7,360 | permissive | /***************************************************************************
*
* Project _____ __ ____ _ _
* ( _ ) /__\ (_ _)_| |_ _| |_
* )(_)( /(__)\ )( (_ _)(_ _)
* (_____)(__)(__)(__) |_| |_|
*
*
* Copyright 2018-present, Leoni... |
c7a42f08e494839555db3b3c059eec51ad0d388b | fb787f2aecac75be684597400e91772b50e25abd | amalgam8/envoy | /test/mocks/server/mocks.cc | C++ | cc | 6,201 | permissive | #include "mocks.h"
#include <string>
#include "common/singleton/manager_impl.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
using testing::Invoke;
using testing::Return;
using testing::ReturnNew;
using testing::ReturnRef;
using testing::SaveArg;
using testing::_;
namespace Envoy {
namespace Server {
MockOpt... |
ed8accff4d8c27a30f857fc210afe1e3c0c4e8b8 | de3d2680e692bc06800f79ad402d12f9ce083104 | yhltpe/swoole-src | /swoole_http_server_coro.cc | C++ | cc | 13,448 | permissive | /*
+----------------------------------------------------------------------+
| Swoole |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the Apache license, |
| that is bundl... |
3a7f75ad19988892ef722a93db148265c3e4da04 | e37936172fb80e4becdae42a3852eb75dc841cf3 | rradogna/GEMCode | /GEMAnalysis/GEMLocalPool/src/GEMLocalPool.cc | C++ | cc | 6,310 | no_license | // -*- C++ -*-
//
// Package: GEMLocalPool
// Class: GEMLocalPool
//
/**\class GEMLocalPool GEMLocalPool.cc GEMAnalysis/GEMLocalPool/src/GEMLocalPool.cc
Description: [one line class summary]
Implementation:
[Notes on implementation]
*/
//
// Original Author:
// Created: Mon Jul 8 19:27:59 ... |
9a481b99bffe884d880bb7edd4f2f8ff7241d631 | b7a1e5fe21bd4fbdbc9ea47e675331766a3ebfb0 | pipmix/DirectXtest | /MySimple/Sprite.cpp | C++ | cpp | 3,136 | no_license | #include "Sprite.h"
Sprite::Sprite(){
m_sourceRect = { 0.0f, 0.0f, 1.0f, 1.0f };
m_topoID = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
}
void Sprite::Create(){
RectF dim;
dim.l = 0.0f;
dim.t = 1.0f;
dim.r = 1.0f;
dim.b = 0.0f;
float zd = 0.0f;
VertexPU verts[] = {
{ XMFLOAT3(dim.l, dim.t, zd), XMFLOAT... |
e36f1b1a66e720fe1885ccfe442773e04491969c | 13ca95cb8744a2545e266742fc1c527028d0d694 | OctopusLian/Dictionary-of-function-algorithms | /11_06/11_06.cpp | C++ | cpp | 219 | no_license | #include <iostream>
#include <string>
using namespace std;
void main()
{
string s("Hello World!");
size_t i=0;
cout<<"s中的字符分别是:"<<endl;
while(i<s.length())
{
cout<<s.at(i);
i++;
}
cout<<endl;
}
|
05a6ae72e5f09111bb13ce0aeffbfc1db16680bf | 697d02f17f24ae91114031f901b48e1e64202f6d | shreyash184/c-codes | /Geeks for geeks/Data-Structure/Array/Easy/Index of an extra element.cpp | C++ | cpp | 535 | no_license | {
#include<bits/stdc++.h>
using namespace std;
int findExtra(int a[],int b[],int n);
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n],b[n-1];
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<n-1;i++){
cin>>b[i];
}
cout<<findExtra(a,b,n)<<endl;
}
}
}
/*This is a function problem.Y... |
8504915839bb2098563288488e6ea4b90881a427 | b4e8885f4648a0281bc41181622b2bb53c41519f | MormonJesus69420/Alien-Prober | /include/Input.hpp | C++ | hpp | 298 | permissive | #pragma once
const int KEY_ID_W = 0;
const int KEY_ID_S = 1;
const int KEY_ID_A = 2;
const int KEY_ID_D = 3;
const int KEY_ID_SPACE = 4;
const int KEY_ID_C = 5;
const int KEY_ID_E = 6;
const int KEY_ID_P = 7;
const int KEY_ID_1 = 8;
const int KEY_ID_2 = 9;
const int MOUSE_LEFT_BUTTON_DOWN = 20;
|
ed7b54c74658308dc715aeaf345d04c8d50d6858 | a6d595d5e69073d922ee8f5d1ec30a2a674ae0b4 | pesterie/nt2 | /modules/boost_math/unit/scalar/ibeta_invb.cpp | C++ | cpp | 2,060 | permissive | //////////////////////////////////////////////////////////////////////////////
/// Copyright 2003 and onward LASMEA UMR 6602 CNRS/U.B.P Clermont-Ferrand
/// Copyright 2009 and onward LRI UMR 8623 CNRS/Univ Paris Sud XI
///
/// Distributed under the Boost Software License, Version 1.0
/// ... |
fbedb77ab9b20b3244febb736bc89f7daea2ebcc | 1669f5b35b51855c5a7603e79a7f2d31a8fb353d | zeroos/embedded-systems-course | /src/led_blink.cpp | C++ | cpp | 327 | no_license | #include <util/delay.h>
#include "Pin.h"
static Pin::Pin<2> button;
static Pin::Pin<13> led;
int main() {
led.mode(OUTPUT);
button.mode(INPUT_PULLUP);
do {
if (!button.read()) {
led.high();
_delay_ms(500);
led.low();
_delay_ms(500);
} else {
led.low();
}
} while (tr... |
1c28faa8252774fbd97644763303d340e8bfc9fb | d5f10d1799a5aea95aa150c229d6ec3ad6eceb81 | noirhero/new_framework | /third_party/entt/entity/view.hpp | C++ | hpp | 29,626 | permissive | #ifndef ENTT_ENTITY_VIEW_HPP
#define ENTT_ENTITY_VIEW_HPP
#include <iterator>
#include <array>
#include <tuple>
#include <utility>
#include <algorithm>
#include <type_traits>
#include "../config/config.h"
#include "../core/type_traits.hpp"
#include "sparse_set.hpp"
#include "storage.hpp"
#include "utility.hpp"
#inclu... |
c50a70febac1deb5af46ac754b58cb54c5fa929e | 99450fe9aee1abb6951a7864fb5dd2f6b881b8f8 | gnishida/OSMEditor3D | /OSMEditor3D/VBORenderManager.cpp | C++ | cpp | 11,618 | no_license | #include "VBORenderManager.h"
#include "global.h"
#include "Polygon3D.h"
VBORenderManager::VBORenderManager() {
}
VBORenderManager::~VBORenderManager() {
Shader::cleanShaders();
}
void VBORenderManager::init(const QVector2D& size) {
this->size = size;
minPos = QVector3D(-size.x() / 2.0f, -size.y() / 2.0f, 0);
m... |
a6c6c699c1fe1960861a9f2ae8453eb0fbd4ae23 | 29d07de5a624d11c187f90e53fe04acaad3967c3 | yesunhuang/Cluster-expansion-approach-for-quantum-calculation | /dev_new/ClusterTool/ClusterTool/complex.cpp | C++ | cpp | 8,163 | no_license | /**
* @ FileName: Complex.c
* @ Function: implement the function of Complex
* @ Author: AyajiLin & YesunHuang
* @ Mail: 493987054@qq.com & 944812203@qq.com
* @ Github: https://github.com/leonardodalinky & https://github.com/yesunhuang
* @ Date: 04/01/2020
*
*/
#include "complex.h"
namespace ayaji {
#ifdef HI... |
7cfbe1bc07bc444d96b9ce5370150e25608d3858 | 8e68eb3ade169338fdcae711127e1a1abc4ac7b7 | anubhawbhalotia/Competitive-Programming | /LeetCode/95. Unique Binary Search Trees II.cpp | C++ | cpp | 2,073 | permissive | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
vector<vector<vector<TreeNode*>>> DP;
public:
void buildTree(int l, int r)
{
if(l > r)
... |
c76d360242b73a463d1a50107564b70da2834812 | 542d01b0b7590b5429ed5b2528409c2dce59840a | sebva/Starfighter4K | /src/game/AsteroidSupernova.cpp | C++ | cpp | 868 | no_license | #include "include/game/AsteroidSupernova.h"
#include "include/engine/GameEngine.h"
AsteroidSupernova::AsteroidSupernova(qreal _dX, qreal _dY,Shooter _from, qreal _dResistance, qreal _dHealthPoint, GameEngine *_gameEngine,qreal _dAngle)
:Asteroid(_dX,_dY,_from,_dResistance,_dHealthPoint,_gameEngine,1)
{
d... |
1cd6e00116f34a29b5e5cb1e3aaf881da15e7a77 | 625281ee4ad28566c650f1e2f8003554797d6a37 | LJK150030/Erudition_Engine | /Code/Engine/Core/ErrorWarningAssert.cpp | C++ | cpp | 10,866 | no_license | //-----------------------------------------------------------------------------------------------
// ErrorWarningAssert.cpp
//
//-----------------------------------------------------------------------------------------------
#ifdef _WIN32
#define PLATFORM_WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif... |
af1ade711c33092f4efc33c7ac31c8fb54be5b50 | b175ad10ccfdcaa1288729eb5468558c70131e1a | Hee-Jae/Algorithm | /boj/15666.cpp | C++ | cpp | 865 | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#define pb push_back
using namespace std;
int N,M;
int arr[10]={};
void btk(vector<int> seq, int index){
seq.pb(arr[index]);
int size = seq.size();
if(size == M){
for(int i=0; i<size; i++) cout << seq[i] << " ";
cout << "\n";
return;
}
v... |
1611af39a3b61a087af6941459e2eafaaef431a5 | 619582edb603e99825bd6d98f3b1c345c49dbfa9 | charsyam/argparser | /example.cc | C++ | cc | 605 | permissive | #include <iostream>
#include "argparser.h"
int main(int argc, char *argv[]) {
utils::ArgParser argParser(argc, argv);
argParser.add("-m", utils::ArgParser::STRING, "memory");
argParser.add("-d", utils::ArgParser::EXISTS, "daemon");
argParser.add("-t", utils::ArgParser::BOOLEAN, "show error");
cons... |
d0c58f6ada4b858cc984e58a69ffbbc04849e2c8 | 016385436f6c21b5cba8ee10834dcaef1b4e50d0 | Quant2017/Design3D | /Intermediate/Build/Win64/Design3D/Inc/AnimGraph/AnimGraphNode_RefPoseBase.gen.cpp | C++ | cpp | 5,092 | no_license | // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
==============================================================... |
a94d91ec8f4a83592728b896535eddb0242b7942 | b32b1995c5b6d6e245d6b2eaaf36a099d51a86a4 | markoelez/Pangolin | /src/video/drivers/firewire.cpp | C++ | cpp | 31,705 | permissive | /* This file is part of the Pangolin Project.
* http://github.com/stevenlovegrove/Pangolin
*
* Copyright (c) 2011 Steven Lovegrove
*
* 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 wit... |
4f4b118e5095c6baad48ec71d7f23bae7ac7206f | 9dadee4d463eeca01906fced78262ce3ef3e30a4 | SimoAntikainen/rl-maze-solver | /src/QMatrix.hpp | C++ | hpp | 957 | no_license | #ifndef QMTRX_HH
#define QMTRX_HH
#include <vector>
#include <tuple>
#include "png/png.hpp"
#include "config_reader.hpp"
//Definition of QMatrix class. This class encapsulates Q,R, and pixel matrices for
//a certain .png-file. Parameters for height, width and numerous other important Parameters
//are stored in this cl... |
d6c7ceca2f2dec98e0a623d6b9717a76ede8d7bb | 0b8e3ff616a9e8d782199a8f181972ea90cfc975 | juliandekievid/se_exercises | /Exercise2/Exercise2/main.cpp | C++ | cpp | 1,457 | no_license | #include <iostream>
#include <string>
#include "rotationmotor.h"
const std::string get_option();
int main()
{
std::cout << "Welcome to this motor demonstration\n";
// Initialize motor1
int motor_speed = 0;
std::string motor_option;
RotationMotor motor1;
do
{
// Get user input
motor_o... |
d76030ae1e3c36df701ee2b3fe0e01735f792a34 | 211829a043e4c76eb1e4bb720ef91117c223716d | fantasticism/clightpipes | /LightPipes/subs.cpp | C++ | cpp | 10,056 | permissive | #include "subs.h"
#define Pi 3.141592654
#define UNWRAP(ol,co,ne)\
val = ol;\
if ((val - co) >= hfactor)\
while ((val - co) >= hfactor) val -= factor;\
else if ((val - co) <= -hfactor)\
while ((val - co) <= -hfactor) val += factor;\
*ne = val;
double Y1getter(double a)
{
return a;
}
double H(int n,dou... |
703e59cc4ca99d658b0749abe4e33ff75eacfa35 | f8f6d831edaa591238a96bd8d28f505f85db4d7b | tanoshiikoushi/libKoushiCommon | /src/checksum/crc32eth.cpp | C++ | cpp | 244 | permissive | #include "checksum/crc32eth.h"
u32 crc32eth(const u8* buf, size_t size)
{
const u8* p = buf;
u32 crc;
crc = ~0U;
while (size--)
crc = crc32eth_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
return crc ^ ~0U;
}
|
eef096c5fd2f815cd69dc57b95d24a2b67a1bfd7 | 44fcfe6024c671db6f7b200efbbec1fa11493438 | jyahina/coursera_brown_belt | /2week/refsctoring/xml.cpp | C++ | cpp | 1,924 | no_license | #include "xml.h"
#include <string_view>
#include <iostream>
using namespace std;
namespace Xml {
pair<string_view, string_view> Split(string_view line, char by) {
size_t pos = line.find(by);
string_view left = line.substr(0, pos);
if (pos < line.size() && pos + 1 < line.size()) {
return {left, line.substr... |
7b88dbe62e01025dbc74b2baf80645ce6d17d867 | 56276ecfc5b7c57e046a24b5f64f65978740872b | compix/Monte-Carlo-Raytracer | /source/engine/rendering/geometry/Mesh.cpp | C++ | cpp | 9,128 | permissive | #include "Mesh.h"
#include <fstream>
#include <assert.h>
#include <engine/util/convert.h>
#include <engine/util/file.h>
#include "GeometryGenerator.h"
#include <engine/util/util.h>
#include "MeshBuilder.h"
Mesh::~Mesh()
{
freeGLResources();
}
void Mesh::load(const MeshData& meshData)
{
ensureCapacity(0);
... |
1feb3af8c6f1516908ced2e1e951daaa0da73f7f | e7d03417f85eba90f9f2e7e51c774abc130f028b | ohager/kantalupe | /src/ModelTreeDataItemInceptor.cpp | C++ | cpp | 3,601 | no_license | #include "ModelTreeDataItemInceptor.h"
#include "global.h"
#include "ModelTreeDataItem.h"
#include "ModelTreeDataItemProtocol.h"
#include "PlainStructures.h"
START_NS
ModelTreeDataItemInceptor::ModelTreeDataItemInceptor()
{
}
void ModelTreeDataItemInceptor::incept(const Category & src, ModelTreeDataItem * dest)
{
d... |
1dfa6fc87a162caf6a238112471a61e47c00d779 | ae4d37b78099e3e843e16df07529457578f03550 | itcgames/ARGO1920-TeamB | /ARGO_Team_B/ARGO_Team_B/SRC/Systems/HealthSystem.cpp | C++ | cpp | 350 | no_license | #include "HealthSystem.h"
HealthSystem::HealthSystem() {}
HealthSystem::~HealthSystem() {}
void HealthSystem::updateComponent(Component* component)
{
HealthComponent* hc = dynamic_cast<HealthComponent*>(component);
if (nullptr != hc)
{
int health = hc->getHealth();
if (health <= 0)
{
hc->dead();
}
/* ... |
886349c849fdbc1191c78f873f11a2cf676bb3e4 | 46ea332e3e387151a2a5e06a822fb2031699e3fe | lauvchen/apollo | /modules/perception/obstacle/camera/cipv/cipv.cc | C++ | cc | 28,824 | permissive | /******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
... |
9225b11ffc5fbc9fd305f152184c1d8d3c2ee24b | 30f1a025d397dc121a830ea9cd532b4d6de41003 | midori42/CTDL-GT2021 | /CTDL_so_fibo_thu_n.cpp | C++ | cpp | 1,680 | no_license | /*
Dãy số Fibonacci được xác định bằng công thức như sau:
F[0] = 0, F[1] = 1;
F[n] = F[n-1] + F[n-2] với mọi n >= 2.
Các phần tử đầu tiên của dãy số là 0, 1, 1, 2, 3, 5, 8, ...
Nhiệm vụ của bạn là hãy xác định số Fibonaci thứ n. Do đáp số có thể rất lớn, in ra kết quả theo modulo 109+7.
Input:
Dòng đ... |
728967a86701870168799eaa3d39464e7dcd7f7d | 0175eda984b967606b4130d625f50e3228968f3d | cool2528/miniblink49 | /third_party/skia/gm/clip_strokerect.cpp | C++ | cpp | 1,744 | permissive | /*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm.h"
#include "SkCanvas.h"
#include "SkPath.h"
class ClipStrokeRectGM : public skiagm::GM {
public:
ClipStrokeRectGM() {
}
protected:
SkString onShor... |
43f3477ebb371e83300ef81d6198d902fd7630fa | d906e641a96e1cc23bda2e76ad57de5c07eb3402 | fkhannouf/AmigaSynergy | /ReactionPlus/Reaction/Label.cpp | C++ | cpp | 395 | permissive | #include "Label.hpp"
#include "Exec/OutOfMemoryException.hpp"
namespace RAPlus {
namespace Reaction {
Object *Label::newObject(struct TagItem *tagItem) {
imageObject = (Object *)IIntuition->NewObjectA(ILabel->LABEL_GetClass(),NULL,tagItem);
if (!imageObject) throw OutOfMemoryException("Could no... |
737538e2343277c936ca551901936d60733561c3 | 0a1ee0c59c96a22822e67b03d62046e347426ee1 | jarven-zhang/PSS_ASIO | /PacketParse_Inferface/PacketParse_Inferface.cpp | C++ | cpp | 5,056 | permissive | // PacketParse_Inferface.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include "define.h"
#include "SessionBuffer.hpp"
#if PSS_PLATFORM == PLATFORM_WIN
#ifdef PACKETPARSE_INTERFACE_EXPORTS
#define DECLDIR extern "C" _declspec(dllexport)
#else
#define DECLDIR extern "C"__declspec(dllimport)
#endif
#el... |
c20f59784105dcc29cb3c8e597024959092df86b | 0a3da417f82169523a851ccabad6c98ae10dbd7a | nithiwut1997/Algorithm-Class | /Solution/Perimeter.cpp | C++ | cpp | 722 | no_license | #include <bits/stdc++.h>
using namespace std;
int n, e, k, a, b;
vector<int> graph[1001];
int state[1001], layer[1001];
queue<int> q;
int main() {
cin >> n >> e >> k;
for (int i = 1;i <= e;i++) {
cin >> a >> b;
graph[a].push_back(b);
graph[b].push_back(a);
}
int front, count = ... |
dcd4acbb48e1dadc40f613dc231339b84334e043 | 90c9220d85a0c576059924a2cddeb8ffe01f480b | delokman/DevInd_1 | /exchangeprojects-3-/archive/WSS/src/ProtocolLibOld/src/ServerProtocolImpl.cpp | C++ | cpp | 3,458 | no_license | #include "stdafx.h"
#include "socket.h"
#include "ServerProtocolImpl.h"
#include "JSONHandler.h"
ServerProtocol::ServerProtocol()
{
//std::string buff;
//int msgtype = 4;
//buff = "{\"msgtype\":4, \"Account\" : 327, \"OrderQty\" : 1, \"ClOrdId\" : \"701\", \"ProductType\" : \"1\", \"Product\" : \"GOLD\", \"Contrac... |
2c32abf1f0dcbc9a915c9ca49b986aa0ef050b7c | aa33bd4f97cf1f2398db97d973090258750a09be | Borzen/SrProject | /SrProject/Engine/soundclass.cpp | C++ | cpp | 8,122 | no_license | #include "soundclass.h"
SoundClass::SoundClass()
{
m_DirectSound = 0;
m_primaryBuffer = 0;
m_secondaryBuffer1 = 0;
}
SoundClass::SoundClass(const SoundClass& other)
{
}
SoundClass::~SoundClass()
{
}
bool SoundClass::Initialize(HWND hwnd)
{
bool result;
// Initialize direct sound and the primary soun... |
3edcd98df8a3edcac758aaa8c5f022e5d5f69a1b | d72e76c481dd0e9f924debe41f69919d7f08f067 | kamalyesh/playgroundThree | /src_old/07_resources_management/Components/ComponentSprite.hpp | C++ | hpp | 731 | no_license | #ifndef Componentte_hpp
#define Componentte_hpp
#include "Component.hpp"
#include "Object.hpp"
#include "../ResourceAllocator.hpp"
class ComponentSprite : public Component
{
public:
ComponentSprite(Object *owner);
// Loads a sprite from file.
void Load(const std::string &filePath);
// We add a new ov... |
ea9c6867863148e52830ef1c277b6701b67e24cc | 0b38d96bfd25e3a3dea0b0b0aa22c0cc6b9722a5 | yzq986/cntt2016-hw1 | /TC-SRM-566-div1-1000/qiaoranliqu.cpp | C++ | cpp | 3,015 | no_license | #include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<string>
#define N 255
#define Mo 100007
using namespace std;
const double pi=acos(-1.0);
struct Point{
double x,y;
}A[N],B[N];
void jia(int &x,int y) { x+=y; if (x>=Mo) x-=Mo; }
double cross(Point a,Point b,Point c... |
1540c2ad44ea79c9e4465d5e7e2b652153b5cef1 | 66e5247a12a86e255ca4927f7d0e6a461ec95ec2 | jhonber/Programming-Contest | /codeforces/Good Bye 2014/B.cpp | C++ | cpp | 1,446 | no_license | // http://codeforces.com/contest/500/problem/B
#include<bits/stdc++.h>
using namespace std;
#define __ ios_base::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define foreach(it, x) for (__typeof (x).begin() it = (x).begin(); it != (x).end(); ++it)
#define all(x) x.begin(),x.end()
#define D(x) cout << #x " = " << ... |
0e7a9d75e2ec7afeb351eab10fe6175531d168d2 | 7e81089c0bd5a8e3cae291dd4992735d1ef82d00 | srmauvsoftware/srmauv | /src/jetson/src/JHPWMPCA9685.cpp | C++ | cpp | 3,614 | no_license | #include <JHPWMPCA9685.h>
#include <math.h>
PCA9685::PCA9685(int address) {
kI2CBus = 0 ; // Default I2C bus for Jetson TK1
kI2CAddress = address ; // Defaults to 0x40 for PCA9685 ; jumper settable
error = 0 ;
}
PCA9685::~PCA9685() {
closePCA9685() ;
}
bool PCA9685::openPCA9685()
{
cha... |
87105065571cb52edd80c974ae4092b13f0c181a | 55685e892fa13395ee508b19b04abd53deb5e626 | rbarreiros/rpidmx512 | /lib-ws28xx/src/pixeltype.cpp | C++ | cpp | 3,765 | permissive | /**
* @file pixeltype.cpp
*
*/
/* Copyright (C) 2021 by Arjan van Vught mailto:info@orangepi-dmx.nl
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including wit... |
7682a394823eb7ca6f7e5d9929722db62cea0b47 | 89c180f2d1b69257fa2ad622823f58d990beab05 | rock-gui/gui-map2d | /src/mapwidget/waypointitem.cpp | C++ | cpp | 9,391 | no_license | /**
******************************************************************************
*
* @file waypointitem.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief A graphicsItem representing a WayPoint
* @see The GNU Public License (GPL) Version 3
* @defgroup ... |
5f226a258e3e98d498c21e0703610ac91c2748f9 | e142868f8a25a00afc6271c9807f52941da931e1 | Turupawn/UE4Plugin | /Source/modio/Private/Schemas/ModioLogo.cpp | C++ | cpp | 471 | permissive | // Copyright 2019 modio. All Rights Reserved.
// Released under MIT.
#include "Schemas/ModioLogo.h"
void InitializeLogo(FModioLogo &Logo, const ModioLogo &modio_logo)
{
Logo.Filename = UTF8_TO_TCHAR(modio_logo.filename);
Logo.Original = UTF8_TO_TCHAR(modio_logo.original);
Logo.Thumb320x180 = UTF8_TO_TCHAR(modio... |
c31397fa66b6ab28600e4767e8f1d46479bc4c5c | c991730c0505a07f8e2ce79dbf87ebbfd7ca7e69 | ayaankhan98/Algorithms-on-graphs | /acyclicity.cpp | C++ | cpp | 1,029 | permissive | #include <iostream>
#include <vector>
#include <stdlib.h>
using std::vector;
using std::pair;
void explore(int i, vector<vector<int>> &adj, int *state)
{
state[i] = 1;
for(auto it2 : adj[i])
{
if (state[it2] == 0)
{
explore(it2, adj,state);
}
if (state[it2] == 1)
{
std::cout<<"1";... |
3d36f04c65a2853558af13de70822113388f4292 | db068af669e8aebdb26952387577c3acaf3cb601 | kelvi5/Kelio | /C++/Jogos/aprendendoqsort.cpp | C++ | cpp | 1,901 | no_license | #include<stdlib.h>
#include<stdio.h>
#include<math.h>
#define NUM_DOCS 10
typedef struct {
float W; //Weight
int doc_id; //Document identifier
} TipoItem;
typedef struct {
TipoItem *I;
int doc_p; //Last document pointer
} TipoLista;
void preenche(TipoLista *L){
int i;
TipoItem Aux;
for(i=0; i<N... |
088bf28d5a69b94d3d24aafdd9d4b99f21da91ef | 7c8b2aad441249422791a0022031287a5db63de8 | kivoSSBM/SpaceLazor | /SFML_Project/Projectile.cpp | C++ | cpp | 1,096 | no_license | #include "Projectile.h"
void Projectile::calcDirection(float angle)
{
float x = 1000.f;
float y = 0.f;
if (angle >= 0 && angle < 90)
{
x = 90-angle;
y = angle;
}
if (angle >= 90 && angle < 180)
{
x = 90-angle;
y = 180-angle;
}
if (angle >= 180 && angle < 270)
{
x = angle-270;
y... |
99e850a1927100af74709c4f84bea18de16658b5 | 670d142f1046fbc0e25aafef1214ae828e7e56cf | naquech/IntroCS1.0 | /7_shoppingCart/ShopCart.cpp | C++ | cpp | 3,528 | permissive | /*Natalia Q. CS_161
Write a main method (in ShopCart.cpp) that displays a menu with the following options (it should loop until the user selects Quit):
Add item: this allows the user to enter the information for a new Item, which is then added to the cart.
List contents: this lists the name, price and quantity for all ... |
af8ae2bb5397dd968b972fa6150a1a3cf7d37c21 | 4cb5551656c5cacf6561ba1c43c7f8ab33135367 | DuJunxiu/Messenger | /base/include/ThreadPool.hpp | C++ | hpp | 510 | no_license |
/*****************************************************
**
** Filename: ThreadPool.h
** Author:
** CreateTime: 2020/9/30
** description: 使用C++11的特性的简单的线程池类
**
******************************************************/
#ifndef __THREAD_POOL_H__
#define __THREAD_POOL_H__
#include <pthread.h>
... |
b5b106217b2f23de252ed6e741355e783865b675 | f23101d3d619dcbb08c6705886d9b753279e7106 | alexwzk/PoRLottery | /bkup/verifier.cpp | C++ | cpp | 3,420 | no_license | #include "verifier.h"
VERIFIER::VERIFIER(std::string root_file, std::string tic_file) {
using namespace std;
ifstream inticket, inroot;
try {
inticket.open(tic_file);
} catch (ifstream::failure& err) {
cerr << err.what()
<< " Open the ticket file @ Verifier 1st constructor." << endl;
exit(FILE_ERR);
}
... |
f1920d586df78c41b30a3ba6f0c0f67d16c32b30 | 43cb48c11937a589039417a794d61fb10c85dd20 | lb9726/Classic-examples-of-practice | /002-C语言相关/自己的/c++项目实训整合完整版libo/c++自己整合完整版/data.cc | C++ | cc | 23,632 | no_license | #include"data.h"
char checknum[6];
int getch()
{
int c=0;
struct termios org_opts, new_opts;
int res=0;
//----- store old settings -----------
res=tcgetattr(STDIN_FILENO, &org_opts);//获取与终端相关的参数
assert(res == 0);
//---- set new terminal parms --------
memcpy(&new_opts, &org_opts, sizeof... |
28df0482c40862d6ea760fc7e02e49e78db86de3 | 5f39939d1aa3c1c2620bc07931d6ebaa1ba2edfe | Tuvie/brpc | /src/brpc/protocol.cpp | C++ | cpp | 9,671 | 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 may... |
82b6dcdf295146e5e69a8587604933ffc2228cd3 | cb4e08bd65204ef662af0a2fc7fa4e376446e6ab | osyo-manga/Sprout | /sprout/optional/hash.hpp | C++ | hpp | 686 | permissive | #ifndef SPROUT_OPTIONAL_HASH_HPP
#define SPROUT_OPTIONAL_HASH_HPP
#include <cstddef>
#include <functional>
#include <sprout/config.hpp>
#include <sprout/optional/optional.hpp>
#include <sprout/functional/hash.hpp>
namespace sprout {
//
// hash_value
//
template<typename T>
inline SPROUT_CONSTEXPR s... |
f11a25836d7f7c09ac18b419db262ee83c3284a4 | 1025b3f8d1c6a58547664c4a8a3984f1d93f9e07 | jixhua/QQmlQuickBook | /sstd_utility/windows_boost/boost/math/distributions/find_location.hpp | C++ | hpp | 6,716 | no_license | // Copyright John Maddock 2007.
// Copyright Paul A. Bristow 2007.
// Use, modification and distribution are subject to 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)
#ifndef BOOST_STATS_FIND_LOCATION_HPP
#define BOOST_STATS... |
9049baa6ee2ce426eb5868704459af31faea8b1b | 93488fec298d8409884210cfd5993c307bc47cb4 | Kanchii/Online_Judge_Problems | /Codeforces/71A_Way_Too_Long_Words.cpp | C++ | cpp | 459 | no_license | #include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vector<ii> > vvii;
typedef long long ll;
int main(int argc, char const *argv[]){
int n;
cin >> n;
while(n--){
string x;
cin >... |
99663ad83b52ac3e31a848fd43e0f81208a39690 | 7da9d38738298c67ae2e6dce21793ae820dd7eb3 | ratharn/cloisim_ros | /cloisim_ros_gps/src/gps.cpp | C++ | cpp | 2,930 | permissive | /**
* @file gps.cpp
* @date 2021-01-14
* @author Hyunseok Yang
* @brief
* ROS2 GPS class for simulator
* @remark
* @copyright
* LGE Advanced Robotics Laboratory
* Copyright (c) 2020 LG Electronics Inc., LTD., Seoul, Korea
* All Rights are Reserved.
*
* SPDX-License-Ident... |
3ebbb7c24ff694afcb831c8a41ee550864b10d64 | 8505a83fa7381a3f9860665ec53ca846fbcf0d37 | wistaria/mptensor | /tests/qr_rank2.cc | C++ | cc | 4,317 | no_license | /*
Apr. 24, 2015
Copyright (C) 2015 Satoshi Morita
*/
#include <mpi.h>
#include <cmath>
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cassert>
#include <mptensor.hpp>
#include "mpi_tool.hpp"
#include "functions.hpp"
#include "typedef.hpp"
namespace tests {
//! Test for TensorD::qr (Matrix... |
e558245ba81e0849d9e9f1b21ccd64719e7a42c3 | 1e9f01f6715cdad948e8dae76abe4cf597836b47 | seuczk/cpp-primer | /chapter3/3_7.cpp | C++ | cpp | 316 | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
string str("hello world");
//while
decltype(str.size()) i = 0;
while(i < str.size())
str[i++] = 'X';
cout << str << endl;
//for
for(decltype(str.size()) i = 0; i < str.size(); ++i)
str[i] = 'X';
cout << str << endl;
return 0;
}
|
2c30600025d986453fa61f3d95c412154c904aff | d8a62e70c38d1818fcbbf02d4b38eb1101afe3f0 | CNURobotics/vigir_pluginlib | /vigir_pluginlib/src/type_class_traits.cpp | C++ | cpp | 546 | permissive | #include <vigir_pluginlib/type_class_traits.h>
namespace vigir_pluginlib
{
#ifdef __GNUG__
#include <cstdlib>
#include <memory>
#include <cxxabi.h>
// enable c++11 by passing the flag -std=c++11 to g++
std::string demangle(const char* name)
{
int status = 0;
std::unique_ptr<char, void(*)(void*)> res
{
ab... |
084f00a0720a2860d98c09cd54a518b0d846e326 | 59d53e76ed63b11d999f357c0e341ce17d04656c | SteelRidgeRobotics/PowerUp_VSCode | /PowerUpCompBotVS/src/main/cpp/RobotMap.cpp | C++ | cpp | 5,307 | no_license | // RobotBuilder Version: 2.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// C++ from RobotBuilder. Do not put any code or make any change in
// the blocks ... |
2147218aaa6e396433563f33db64f713198a4a78 | 9d567fd42c335c603263676ed4ab4acf698ca7b3 | Netavo/NetavoCore | /src/messagesigner.cpp | C++ | cpp | 2,061 | permissive | // Copyright (c) 2014-2017 The NETAVO Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h"
#include "hash.h"
#include "validation.h" // For strMessageMagic
#include "messagesigner.h"
#include "... |
377d0eb268077294755c3e8cf79d383519710630 | 0cd58aa60bc48834bc6476299ac786a64ba2b58f | erwinbonsma/BumbleBots | /BumbleBots/Tiles.cpp | C++ | cpp | 15,257 | permissive | /*
* Bumble Bots, a Gamebuino game
*
* Copyright 2018, Erwin Bonsma
*/
#include "Tiles.h"
#include "Globals.h"
#include "Images.h"
#include "Movers.h"
#include "Objects.h"
#include "TileTypes.h"
#include "Palettes.h"
Tiles _tiles = Tiles();
// Exposed in Globals.h
Tiles& tiles = _tiles;
const uint8_t numIsolin... |
1805b1f13b01590979d8c6251c30cc906a3171db | 39e9dc50cd62957b72f8d1049b2d637206bc9bd5 | dejan-stankovic/pmtech | /examples/code/play_sound/play_sound.cpp | C++ | cpp | 4,102 | permissive | #include "audio/audio.h"
#include "debug_render.h"
#include "file_system.h"
#include "loader.h"
#include "memory.h"
#include "pen.h"
#include "pen_string.h"
#include "renderer.h"
#include "threads.h"
#include "timer.h"
pen::window_creation_params pen_window{
1280, // width
720, // height
4, ... |
b2ad74cd41cc0c68f473caaa6a3e90a9fb21043d | 1ca6648b4dfbb889a709a96c89c65fbdd253d792 | opendarkeden/server | /src/Core/GCPartySayHandler.cpp | C++ | cpp | 638 | no_license | //--------------------------------------------------------------------------------
//
// Filename : GCPartySayHandler.cpp
// Written By : Reiot
//
//--------------------------------------------------------------------------------
// include files
#include "GCPartySay.h"
#include "Player.h"
//---------------------... |
ecff7d151c6cce7923245a4f5daedebd01165a48 | bf559859d822efc734c425f3551f6016f13e90d9 | zeyiwu/chromium | /components/viz/service/display/overlay_strategy_underlay.cc | C++ | cc | 3,068 | permissive | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/viz/service/display/overlay_strategy_underlay.h"
#include "build/build_config.h"
#include "components/viz/common/quads/draw_quad.h"
... |
3fd855c2511972d42014db01410d638ea42f1db8 | 5756274bddabc56a7d52981c17da745b5af92b6e | VirtDexCoinvir/virtdex | /src/VirtDexd.cpp | C++ | cpp | 6,435 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2014-2017 The VirtDex Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparams.h"
#... |
cb8d387b0281379a6e85a2d989ecfb4ddd47e41c | eda613557e9b8de7edfc44a0607fbc97ef9b5100 | Yuvrajchandra/HackerRank-CPP-Programs | /Basic Data Types.cpp | C++ | cpp | 398 | permissive | #include <iostream>
#include <cstdio>
#include<iomanip>
using namespace std;
int main() {
// Complete the code.
int a;
cin>>a;
long b;
cin>>b;
char c;
cin>>c;
float d;
cin>>d;
double e;
cin>>e;
cout<<a<<endl;
cout<<b<<endl;
cout<<c<<endl;
cout<<fixed<<setprec... |
1ef4c942db0d972d85b7ba6bf408e7f216a5f2eb | bf52ed6a15166f34231a1d571b7248e582a6bfe7 | BlairArchibald/YewPar | /apps/decision/sip/graph.cc | C++ | cc | 856 | permissive | /* vim: set sw=4 sts=4 et foldmethod=syntax : */
#include "graph.hh"
#include <algorithm>
using std::count_if;
Graph::Graph(int size)
{
if (0 != size)
resize(size);
}
auto Graph::_position(int a, int b) const -> AdjacencyMatrix::size_type
{
return (a * _size) + b;
}
auto Graph::resize(int size) ->... |
ea341fe81f640af6f21deafbbc7165665159d307 | 39de71caeda428958b75f8af4534224bf026bbbe | craig08/MoFREAK_Hardware | /mofreak/mofreak/SVMInterface.cpp | C++ | cpp | 15,783 | no_license |
#include "SVMInterface.h"
SVMInterface::SVMInterface()
{
line = NULL;
max_line_len = 1024;
predict_probability = 0;
max_nr_attr = 64; // this is dumb. no way.
}
void SVMInterface::exit_input_error(int line_num)
{
fprintf(stderr,"Wrong input format at line %d\n", line_num);
exit(1);
}
char* SVMInterface::readl... |
f979c3bded7fc7e174501bf700f389b5ef0c8193 | e04dfd1a9a04c8df6ad267fada28382710d9c328 | pmanoonpong/gorobots_edu | /practices/adaptive_locomotion_control_course/CoppeliaSim_Edu_V4_0_0_Ubuntu18_04/programming/libPlugin/simStubsGen/cpp/stubs.cpp | C++ | cpp | 40,427 | no_license | #py from parse import parse
#py import model
#py plugin = parse(pycpp.params['xml_file'])
#include "stubs.h"
#include <cstdlib>
#include <iostream>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#define CATCH_AND_RETHROW(prefix) \
catch(std::exception &ex) \
{ ... |
f0e5f9c36b226da386a4ec57b5ab569cb2fbf094 | 375e459e5bbeb6051a2f2981f2f79f6b4e63c788 | mailtoy/WSP_Payroll | /DeleteEmployeeTransaction.cpp | C++ | cpp | 348 | no_license | #include "DeleteEmployeeTransaction.h"
#include "PayrollDatabase.h"
extern PayrollDatabase GpayrollDatabase;
DeleteEmployeeTransaction::~DeleteEmployeeTransaction(){
}
DeleteEmployeeTransaction::DeleteEmployeeTransaction(int empid)
: itsEmpid(empid)
{
}
void DeleteEmployeeTransaction::Execute()
{
GpayrollDatabase... |
669182df71c64adfeb8267557f8217cdae566534 | 47f431029a3315b51c5a58e3ebf9de9372d3ab4b | TheTypoMaster/ElastosRDK5_0 | /Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/text/style/DynamicDrawableSpan.cpp | C++ | cpp | 2,655 | permissive | #include "text/style/DynamicDrawableSpan.h"
#include "graphics/CRect.h"
using Elastos::Droid::Graphics::IRect;
using Elastos::Droid::Graphics::CRect;
namespace Elastos {
namespace Droid {
namespace Text {
namespace Style {
const CString DynamicDrawableSpan::TAG = "DynamicDrawableSpan";
DynamicDrawableSpan::DynamicD... |
e56daba3954ff5af3fea57364a79a49ef5445071 | b3f548996d702ad49b761ed9db66cf6579f05756 | bruce1408/Alogrithm_Datastruct | /Array/169_Majority_Element.cpp | C++ | cpp | 1,945 | no_license | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
/**
* 169 给定一个数组,然后找出这个数组出现次数大于n/2的元素,限定O(N)时间和O(1)的空间
* Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
* You may assume that the array is non-empty and... |
37d47c4e5fd368198503de305d4549bcd7d11966 | 64de3a1d2a4d5806b8d9b393c3575589e24bed38 | jiejanezhang/oneDPL | /test/rng_testsuite/conformance_tests/ranlux_24_48_base_test.pass.cpp | C++ | cpp | 6,010 | permissive | // -*- C++ -*-
//===-- ranlux_24_48_base_test.cpp ----------------------------------------===//
//
// Copyright (C) Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// This file incorporates work covered by the following copyright and permission
// notice:
//
// Part of the LLVM Projec... |
2787fc8c3bf58cfe964642788d745feb4f6b7b33 | b538d5d83e6cd7e2736faa43dfd4b5be6f29060a | End1-1/Resort | /RowEditor/rerestmenunames.cpp | C++ | cpp | 674 | no_license | #include "rerestmenunames.h"
#include "ui_rerestmenunames.h"
#include "cacherestmenu.h"
RERestMenuNames::RERestMenuNames(QList<QVariant> &values, QWidget *parent) :
RowEditorDialog(values, TRACK_MENU_NAME, parent),
ui(new Ui::RERestMenuNames)
{
ui->setupUi(this);
addWidget(ui->leCode, "Code");
addW... |
4f85c3f9f41c465aae267be3aaa781936b6881d5 | 8eacf2b0e426a26b2f4228378859c24d7c78510d | rmvermeulen/SFML-app | /SFML-app/Game.cpp | C++ | cpp | 684 | no_license | #include <SFML/Graphics.hpp>
#include "Game.h"
#include <vector>
Game::Game() {
}
Game::~Game()
{
}
void Game::load()
{
std::map <std::string, std::string> assets {
{ "spaceship", "./assets/spaceship.png" },
// { "player", "./assets/player.png" },
};
for (const std::pair<std::string, std::string>& info ... |
22cabc1815193180e5ff179c57240bccd675192a | 53f64cb56f32ec9b960dc93a65eea4fa536416e7 | adzhou/oragle | /WebKit/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp | C++ | cpp | 13,784 | permissive | /*
* Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
* Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
* Copyright (C) 2011 Dirk Schulze <krit@webkit.org>
*
* This library is free software; y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.