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 |
|---|---|---|---|---|---|---|---|---|
15b8acfa871c00d1480b2d4f2f24cb0f436cddd6 | fe657123649a0a6835c41478e09c49dcf7a60b3a | ARM-software/patrace | /patrace/src/integration_tests/oes_texture_stencil8.cpp | C++ | cpp | 3,462 | permissive | #include "pa_demo.h"
static GLuint gvPositionHandle;
PACKED(struct params
{
GLuint count;
GLuint primCount;
GLuint first;
GLuint baseInstance;
});
const char *vertex_shader_source[] = {
"#version 300 es \n"
"in vec4 vPosition; \n"
"out vec4 c; \n"
" "
"void main() \n"
"{ \n"
... |
1214ca404446d34386c64fd0ba1da046cc85809e | 613b6d2b35a11c24db80a3da388d246097ea584f | danf42/memhunter | /libs/boost/geometry/srs/projections/impl/pj_zpoly1.hpp | C++ | hpp | 3,686 | permissive | // Boost.Geometry (aka GGL, Generic Geometry Library)
// This file is manually converted from PROJ4
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2017.
// Modifications copyright (c) 2017, Oracle and/or its affiliates.
// Contributed and/or modified by A... |
f358ff090b54fc7ef385b54d0d522f4038225604 | 4bef2f8135e654e9a829a42cfcc38c84087bcbb5 | qfs1998/c-_primer_solutions | /02_P177_异常处理_try_throw_catch/02_P177_异常处理_try_throw_catch/源.cpp | C++ | cpp | 1,151 | no_license | //try和catch配套,throw抛出异常,终止当前行数,由catch抓住,由catch执行异常处理。
#include<iostream>
#include<stdexcept>
using namespace std;
/*int main() 5.24
{
int a, b;
cin >> a >> b;
if (b == 0)
throw std::runtime_error("divisor can't be zero.");
cout << static_cast<double>(a) / b << endl;
system("pause");
return 0;
}*/
int main()
... |
48b1289a145b9e45e05380d6d917012750866a34 | 210a8c47659089a1a22527f2d635a939ad5ffe83 | lehoang123/pcl | /filters/include/pcl/filters/impl/frustum_culling.hpp | C++ | hpp | 7,825 | permissive | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2012-, Open Perception, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following condition... |
4c41c1aa8bd09d05cc64ec5058a1121ee7406140 | 31d4623556a41a283b451a73bb1932a6ee282b1c | Ligvest/Coursera._Art_of_modern_cpp_programming | /3_RedBelt/Week 5/Move/grouping(has copies).cpp | C++ | cpp | 3,254 | no_license | #include "test_runner.h"
#include <algorithm>
#include <list>
#include <set>
#include <string>
#include <vector>
using namespace std;
template <typename String>
using Group = vector<String>;
template <typename String> // == <
using Char = typename String::value_type;
template <typename String>
bool includesSymbol... |
bf937e66a6b5d01f93e7f21888273c1ccbd0fa7c | f7e97d56ec4df6bd851525e78229eb704638652c | jfreax/mergerfs | /src/create.hpp | C++ | hpp | 990 | permissive | /*
Copyright (c) 2016, Antonio SJ Musumeci <trapexit@spawn.link>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" ... |
c9ba033a35402c76d89e547885c6f652066e5e79 | 7d2fccb7add8fbd24e1803b051ea46c84b538658 | intWang/ToolBox | /ToolBox/ToolBoxLogicMgr.cpp | C++ | cpp | 1,459 | no_license | #include "ToolBoxLogicMgr.h"
#include "apcom/contypes.h"
#include "apcom/concombaseutil.h"
#include "LocalDefine.h"
CON_DEFINE_IID(ToolBoxlogicClassFactory, "FA7D46A5-35C5-494B-8AB4-30AC7555AD9D")
const QString g_strDllName = "ToolBoxlogic.dll";
bool ToolBoxLogicMgr::LoadToolBoxLogicModule()
{
m_dllLogic.setFileN... |
f7d2b327e1047500689f4fb6eaad697052416a61 | 58483c1ca15dc9f8fc20c6d039635534036ee839 | drobertduke/envoy | /test/common/http/http1/conn_pool_test.cc | C++ | cc | 18,692 | permissive | #include "common/buffer/buffer_impl.h"
#include "common/http/codec_client.h"
#include "common/http/http1/conn_pool.h"
#include "common/stats/stats_impl.h"
#include "common/upstream/upstream_impl.h"
#include "test/common/http/common.h"
#include "test/mocks/event/mocks.h"
#include "test/mocks/http/mocks.h"
#include "tes... |
4cab39536cd35f924023192f344dfd3e4c352702 | 90c7e484a8fbcf3b375219dd4ef17124c6fbf0d3 | NoraXie/LeetCode_Archiver | /LeetCode/cpp/208.cpp | C++ | cpp | 896 | permissive | class Trie {
struct TrieNode {
vector<TrieNode *> next;
bool is_end;
TrieNode() : next(vector<TrieNode *>(26, nullptr)), is_end(false) {}
};
TrieNode *root;
public:
Trie() {
root = new TrieNode();
}
void insert(string word) {
auto node = root;
f... |
51f4f4044483acfa2bede88c6909b1c59d036ce3 | c40b9051e00b84dfea3c4e2bb27e1e292b57575b | SarahMohamedLotfy/Game-with-OpenGl-and-C- | /common/textures/texture_utils.hpp | C++ | hpp | 536 | no_license | #ifndef TEXTURE_UTILS_HPP
#define TEXTURE_UTILS_HPP
#define GLM_FORCE_CXX11
#include <glm/glm.hpp>
#include "texture2d.hpp"
#include "texture_cube.hpp"
class TextureUtils {
public:
static Texture2D* SingleColor(glm::vec4 color={1,1,1,1}, glm::ivec2 size={1,1});
static Texture2D* CheckerBoard(glm::ivec2 size,... |
ec8038168a0920895d5a5543427422bf4428ea20 | f218135cc8efa98a79ba7b7a5a3bba86403683f7 | hksonngan/kvs | /Example/SupportQt/SimpleTriangle/main.cpp | C++ | cpp | 2,395 | no_license | /*****************************************************************************/
/**
* @file main.cpp
* @brief Example program to display a simple triangle using Qt.
* @author Naohisa Sakamoto
*/
/*----------------------------------------------------------------------------
*
* Copyright (c) Visualization L... |
2c2c0633bf2147f3fdcd8bb22c527e48ca9ea171 | a4481bb4d99ee4c64b5194d15bdbc40b9e8f2c70 | parsa/blaze | /blazetest/src/mathtest/operations/smatdmatadd/HCbUDb.cpp | C++ | cpp | 4,206 | permissive | //=================================================================================================
/*!
// \file src/mathtest/operations/smatdmatadd/HCbUDb.cpp
// \brief Source file for the HCbUDb sparse matrix/dense matrix addition math test
//
// Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
//
// ... |
1da45d3870f5faff1ce58d59f7dc799cb3d580e7 | f91f1305ee30af708443e6a9a8bbb3fae2cc0b80 | AnBaolei1984/Paddle-Lite | /lite/backends/x86/jit/gen/sgd.cc | C++ | cc | 4,016 | permissive | /* Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... |
9ccc880f8b3a448680ce9c051a99accd9a41ba15 | e9ef25a2342a1be4746fc42d0da06780b770abd1 | YSeredich/stepik-courses | /introduction-cpp/module-1_introduction-cpp/lesson-8_2vector/step-04.cpp | C++ | cpp | 723 | no_license | #include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main()
{
// чтение
int n;
cin >> n;
char a[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == (n) / 2
|| j == (n) / 2
|| j == i
|| i == n - j - 1) {
a[i... |
cac383083c4e2ffc3d4062996987c29790b08018 | 9f98963f3c08bbd7065eb61a2ac54ba628906393 | antoniopalome/CEPC | /Alegría Oriental.cpp | C++ | cpp | 216 | no_license | #include<iostream>
#include<string>
using namespace std;
int main(){
int num,b=0,c=0,d;
std::cin>>d;
while(c<d){
b=0;
cin>>num;
while(b<num){
cout<<"w";
b++;
}cout<<"\n";
c++;
}
}
|
0191b8414813a900cfc5e5f60c79c93324c276ed | e6ec0e08c95191ca7cbd352656b87b330a2079a4 | nileshrathi/interviewbit | /binary_search/allocate_books.cpp | C++ | cpp | 1,060 | no_license | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll get_no_of_stu(vector<int> &A, int min_books)
{
ll count=1;
ll temp=0;
for(ll i=0;i<A.size();i++)
{
temp=temp+A[i];
if(temp>min_books)
{
count++;
temp=A[i];
... |
cedd033aeb88118915df138a5ae83dd3ed2d4eb4 | 74cc194f3b0a44b0bd2729d3a98d52b2d641d394 | axax002/ProcessHook | /ProcessHook/PETools.cpp | C++ | cpp | 6,641 | no_license | #include <stdio.h>
#include <Windows.h>
#include "PETools.h"
PIMAGE_DOS_HEADER getDosHeader(void* pFileBuffer) {
return (PIMAGE_DOS_HEADER)pFileBuffer;
}
PIMAGE_NT_HEADERS getNTHeader(void* pFileBuffer) {
return (PIMAGE_NT_HEADERS)((size_t)pFileBuffer + getDosHeader(pFileBuffer)->e_lfanew);
}
PIMAGE_FILE_HEADER getF... |
08f182e1a007c5a13c3c13b5c309927aeb551c5f | 9bdf7e01155746f55d05eaf4f5ba38066dfb05fa | tater1337/cplusplus-fvtc | /test_prctice/test_prctice/main.cpp | C++ | cpp | 430 | no_license | #include <iostream>
#include <conio.h>
#include <string>
using namespace std;
int main()
{
int index=0;
cout << "how many names";
cin >> index;
string *names= new string[index];
for (int i = 0; i < index; i++)
{
cout <<"Name #"<<i+1 <<"?";
cin >> names[i];
}
cout << "Name:";
for (int i = index-1; i >= 0... |
926a48768871fbfbfa9e73cf59da5421aaa12a55 | 8e27e838b30e2fe05e19cf7630ad45f87934d3fa | SirTorresDev/EDA | /1ªParte/EjerciciosEDA/CF13/CF13/InvertirLosDigitosDeUnNumero.cpp | C++ | cpp | 1,215 | no_license |
// Roberto Torres Prensa
#include <iostream>
#include <fstream>
using namespace std;
struct solucion {
long long int numero = 0;
int pot = 1;
};
//{Precondicion: 0 <= n <= (2^31)-1}
solucion invertir(long long int numero) {
solucion resultado;
if (numero != 0) {
resultado = invertir(numero / 10);
resultad... |
345d7563a8531462068d72925efd156a622df898 | 5edbe113546aa2b0666c85633091355120bd760e | footoredo/Gungnir | /Code/7-28/a.cpp | C++ | cpp | 2,324 | no_license | #include <bits/stdc++.h>
#define foreach(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++ it)
#define recycle(a) (__typeof(a))(a).swap(a)
const int MODN = 1e9 + 9;
int n, P, len;
std::vector<std::vector<int> > digit;
int f[60][1<<8], g[60][9][20][1<<8];
__inline void add(int &g0, int g) {
g0 =... |
f885a0cfe21c1e8efea46e3b276b8711707c8978 | ec211cc8c07b811432b9e79a40d76bafa7729543 | rdhafidh/IrrlichtBAW | /examples_tests/19.SIMDmatrixMultiplication/main.cpp | C++ | cpp | 12,202 | permissive | #define _IRR_STATIC_LIB_
#include <irrlicht.h>
#include <intrin.h>
#include <immintrin.h>
#include <chrono>
#include <random>
#include <cstdlib>
#include <cstring>
#include <limits>
// _mm256_extractf128_ps for extracting hi part
// _mm256_castps256_ps128 for extracting lo part (no cycles!)
#define EXEC_CNT (1e6)
#d... |
35dcd0ec93d0f2af01ad6d9b01faf2889b5976a2 | b16a20e17c1fa4192ccc1d87aafba5215817d1dc | m-kus/mpipe | /mpipe_binding/extensions_binding.hpp | C++ | hpp | 900 | permissive | #pragma once
#include <binding.hpp>
#include <mcast/mcast_extension.hpp>
#include <extensions/ext_order_book_top.hpp>
#include <extensions/ext_order_book_agg.hpp>
using namespace mpipe;
inline void ExtensionsBinding(py::module& m)
{
py::class_<McastExtension>(m, "McastExtension")
.def(py::init<const std::string&>... |
48becd4bd4239ea47a69e6d59265fd02b7c35b25 | df693b99a07673c1fdca9cb6d41ed263299a33cf | ali94s/Sort | /select_sort/SelectSort.cpp | C++ | cpp | 485 | no_license | #include<iostream>
using namespace std;
//时间复杂度是O(N^2)
//选择排序每趟下来选出一个最大的或者最小的放在首位
void SelectSort(int arr[],int len)
{
for(int i=0;i<len;i++)
{
for(int j=i+1;j<len;j++)
{
if(arr[j]<arr[i])
swap(arr[i],arr[j]);
}
}
}
int main()
{
int arr[]={1,5,7,9,2,4,3,6,8};
SelectSort(arr,sizeof(arr)/sizeof(arr[0... |
745975190fae77f55a41ad2f9ae8ecf4505567e5 | cc92d12a853ee100be15169a6e1e9239b98a5584 | PureseqTM/PureseqTM_Package | /source_code/AA_to_CODE.cpp | C++ | cpp | 2,809 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
//======================= I/O related ==========================//
//-------- utility ------//
void getBase... |
4e26d51f4369c81972ec82957fc142ab761159fa | ec7c987ef21341719969904576cdbaf468344066 | matse-darmstadt/game-of-life | /src/main/cpp/Source.cpp | C++ | cpp | 2,950 | no_license | #include <iostream>
#include <stdlib.h>
#include <time.h>
#include <set>
#include <Windows.h>
#include <vector>
#include <cassert>
#include "Board.h"
using namespace std;
void simpleTest()
{
vector<uint> livingX, livingY, firstHalfX, secondHalfX, firstHalfY, secondHalfY;
uint size = 10;
Board emptyBoard(size,si... |
886a7b24ebbd51cce04175a932e6c80c7409b2c0 | 0430968e5399be6eefc922aa10eb9743c9433563 | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE127_Buffer_Underread/s02/CWE127_Buffer_Underread__CWE839_rand_74a.cpp | C++ | cpp | 3,018 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE127_Buffer_Underread__CWE839_rand_74a.cpp
Label Definition File: CWE127_Buffer_Underread__CWE839.label.xml
Template File: sources-sinks-74a.tmpl.cpp
*/
/*
* @description
* CWE: 127 Buffer Underread
* BadSource: rand Set data to result of rand(), which may be z... |
b0b3ce302eef61114c177502402d1ffc032baf1a | a310399ba1c05d1f5d58358570cd93fbca0c34a7 | VicSch/Prata_S_Cpp_2011 | /Chapter_07/ch_7.8_functins_string_class.cpp | C++ | cpp | 422 | no_license | #include <iostream>
#include <string>
using namespace std;
void display(const string str[], int n);
int main() {
const int SIZE = 5;
string list[SIZE];
for (int i = 0; i < SIZE; ++i) {
cout << "Enter word #" << i+1 << ": ";
getline(cin, list[i]);
}
display(list, SIZE);
cin.get();
}
void display(const s... |
7f32ab612797a88a585e81b455d006f76c58a7be | dde2073c1243cc461ce16fff5ee7e7c26af204c8 | Roodram/Semaphore_Applications | /Sleeping_Barber/Sleeping_Barber_InbuiltSemaphores.cpp | C++ | cpp | 1,367 | no_license | #include <iostream>
#include <pthread.h>
#include <semaphore.h>
#include <random>
#include <unistd.h>
using namespace std;
#define MAX_QUEUE_LEN 10
int waitingCustomers=0;
int maxCustomers = 40;
sem_t customerQueue, barberReady;
pthread_mutex_t mutex;
void* barber(void* arg){
int haircuts = 0;
while(haircuts<maxC... |
fdb1cd0211f4d711f5a537cd08fa356f4a5af65c | bf87f6f079c8bbc193c684a20e27c23192915609 | wangfeilong321/OSGAddOnsGV | /Bindings/Python/OSGSystem/module/generated/ChunkMaterialBase.pypp.hpp | C++ | hpp | 1,281 | no_license | // This file has been generated by Py++.
// PyOpenSG is (C) Copyright 2005-2009 by Allen Bierbaum
//
// This file is part of PyOpenSG.
//
// PyOpenSG is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; ... |
2dcdccad68b83c72ff827a6fb7bb687d0f900f9b | 617cba1303416c13165dce0200dde6e5f0b788ab | eaglezzb/Sankore-AppToolkit | /src/gui/WebDocument.cpp | C++ | cpp | 383 | no_license | #include "WebDocument.h"
WebDocument::WebDocument(const QString& docName, const char *name, QWidget *parent):DocumentWidget(docName, name, parent)
{
mPath = docName;
mpWidget = new QWebView(this);
mpLayout->addWidget(mpWidget);
dynamic_cast<QWebView*>(mpWidget)->load(docName);
}
WebDocument::~WebDocu... |
2bad83a2ebfd3e827d07e7b971581de5633ef90e | 605d27d7fedb58bbb3e23fc5497a156796280da6 | freebsd/freebsd-ports-haskell | /devel/electron19/files/patch-content_browser_renderer__host_delegated__frame__host.cc | C++ | cc | 723 | permissive | --- content/browser/renderer_host/delegated_frame_host.cc.orig 2022-05-25 04:01:00 UTC
+++ content/browser/renderer_host/delegated_frame_host.cc
@@ -289,7 +289,7 @@ void DelegatedFrameHost::EmbedSurface(
if (!primary_surface_id ||
primary_surface_id->local_surface_id() != local_surface_id_) {
-#if BUILDFLAG... |
3ac3a334875fcbcf5ecc4e47310e14e0fda8fc84 | 9e02a16a89fb4294bac1479f3666df5409b2cbbb | scherererer/Fast-RTPS | /test/blackbox/RTPSAsSocketWriter.hpp | C++ | hpp | 9,138 | permissive | // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless re... |
5a89e39e365a8b0752fca1b6c01773211fa41a36 | f2eb16aa8e6640340b66530ef1c3298ce41839d5 | Unilang/grpc | /src/cpp/common/tls_credentials_options.cc | C++ | cc | 4,018 | permissive | /*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
2606617cd283de3220ce0b19f9e8bc1c9caff916 | a6504aed9f82201c804927da9892001844418890 | SachiSakurane/libmk2 | /include/mk2/math/sync.hpp | C++ | hpp | 632 | permissive | //
// Created by Himatya on 2019-03-25.
//
#pragma once
#include <type_traits>
#include <mk2/math/constants.hpp>
#include <mk2/math/sin.hpp>
namespace mk2{
namespace math{
template<class T, typename = typename std::enable_if<std::is_floating_point<T>::value>::type>
inline constexpr T sync(T x)
{
... |
d14ed6b4ff01088e877ccb4a13fe70760be333ae | aebfa90cb3a5ba5141f3b492b120a1aa17f34f86 | yoonnyeong/Algorithm_ex | /알고리즘 문제해결기법/5H.cpp | C++ | cpp | 1,125 | no_license | #include <iostream>
#include <stdio.h>
#include <algorithm> //max, min을 사용하기 위해
using namespace std;
int getArea(int la, int ra, int ta, int ba, int lb, int rb, int tb, int bb){
int lr, rr, tr,br; //겹치는 영역의 좌표들
lr = max(la, lb);
rr = min(ra, rb);
tr = min(ta, tb);
br = max(ba, bb);
// 둘이 겹치는 영역이 있을 때
if( lr <=... |
234fdd7a9ea3a21615aa41767932cf0f83ff2653 | cce802fab42ad6d4cdad998e950b5fb823288e74 | trimone/_Allgemeines_Projekt | /_Allgemeines_Projekt/18_02_02__Rekursive_Funktionen.cpp | C++ | cpp | 1,945 | no_license | /*===========================================================================================
TINFkjhdjhdmsmnnsmns
NAME: ALEX HUBER KLASSE: FTE1 DATUM: 26.01.18
PROJEKT: Intervallschachtelung am Beispiel Wurzel 2
===========================================================================================*/
/// DAS ... |
d76447f90d033ebc947c08d3efee5eaba2340a73 | f1613b73a103e392fc2e6f18ddfced26f48d7c7a | jeffuong/FTL | /FTL/vector.hpp | C++ | hpp | 20,326 | no_license | // All content copyright (C) Allan Deutsch 2017. All rights reserved.
#pragma once
#include "allocator.hpp" // ftl::default_allocator
#include <limits> // needed for allocator::max_size
#include <iterator> // ::std::reverse_iterator<>
#include <utility> // ::std::distance
#include <memory>
#include <cassert>
namesp... |
5c411f2a05392ea33540d47a468a66e8d6da1acf | 9f4663256784d309f4be57ddb8efd7dda422aa13 | mse-gpu/Rippling | /src/cpp/RipplingOMP.cpp | C++ | cpp | 1,063 | no_license | #include <iostream>
#include <cmath>
#include "omp.h"
#include "RipplingOMP.hpp"
RipplingImageOMP::RipplingImageOMP(int m, int n, DomaineMaths domain) : RipplingImage(m,n,domain){
//Nothing to init
}
void RipplingImageOMP::refreshAll(const DomaineMaths& domainNew){
const int w = getW();
const int h = get... |
e43fcf9740e1a0b8efb9e596b0db37785be6f982 | e74bf60bcab3f078afb828ad55b6c02540b7699d | a21802/programming-trainning | /C++/image processing/35. spectrum/spectrum/main.cpp | C++ | cpp | 2,075 | no_license | #include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
void fft2Image(InputArray _src, OutputArray _dst)
{
Mat src = _src.getMat();
CV_Assert(src.type() == CV_32FC1 || src.type() == CV_64FC1);
CV_Assert(src.channels() ==... |
28d795ada0e54a02b1ffd3e64ec96fc62b09e890 | a31d4146d919d60ead1d6316b54a4932055201d4 | google/orbit | /third_party/concurrentqueue/tests/relacy/relacy/example/examples/examples.cpp | C++ | cpp | 351 | permissive | #include "stdafx.h"
#include "spsc_overwrite_queue.hpp"
#include "amp_condvar.hpp"
int main()
{
rl::test_params p;
p.iteration_count = 10000;
//p.search_type = rl::sched_bound;
//p.context_bound = 3;
rl::execute<spsc_overwrite_queue_test, 2>(p);
rl::simulate<amp_condvar_test>(p);
rl::simu... |
8f36547372eec12b259616f9be9a629e98a5554a | a8c24fd244ad14523b3bc5d71a3437135e279122 | junxuezheng/chromium | /chrome/browser/sharing/sharing_service_factory.cc | C++ | cc | 5,078 | permissive | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/sharing/sharing_service_factory.h"
#include <memory>
#include "base/memory/singleton.h"
#include "chrome/browser/gcm/gcm_profil... |
b937e9464b18a9fb8c919619124989895904ea3d | 568611a32a6b92bd1be48c80ed108ad3481a5b9e | WimpPgK/Cpp__Connect4_alfaBeta_minMax | /sztucznaInteligencja.cpp | C++ | cpp | 15,387 | no_license | #include <iostream>
#include <windows.h>
#include "sztucznaInteligencja.h"
#include "losowaniebezpowtorzen.h"
using namespace std;
SztucznaInteligencja::SztucznaInteligencja()
{
}
int SztucznaInteligencja::znajdzNajlepszyRuch(int** tab,int player, int poprzedniRuch_x, int poprzedniRuch_y)
{
int* t... |
a911af71f0d4605cd76518508fe87f5c82b1519f | 950f70bc675c07dadfbb0a8f1cbac3039175815a | lntoly/ffead-cpp | /modules/apache_mod_ffeadcpp/mod_ffeadcpp.cpp | C++ | cpp | 20,310 | no_license | /*
Copyright 2009-2012, Sumeet Chhetri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... |
b8a6a9191e5614edb4aaafaa6e4d210d8e37781f | 85660fa6693a57171559ca80175590c9de5ada0e | alexandraback/datacollection | /solutions_1482494_0/C++/Theorem/b.cc | C++ | cc | 1,612 | no_license | #include <map>
#include <iostream>
#include <string>
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
int values[2000][2];
struct pts {
int stars;
};
long long score(int i, int current) {
// none valid.
if (values[i][0] < 0 && values[i][1] < 0) return -1;
// first one valid
... |
abdbb601ecd11a2279985c332f3eaf8c74f27d56 | 2bbdd0eb14911fd3b8c61a03b330b03aa7cfe498 | vladimir-polin/oneDPL | /test/parallel_api/algorithm/alg.nonmodifying/find.pass.cpp | C++ | cpp | 2,804 | permissive | // -*- C++ -*-
//===-- find.pass.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... |
9d873d406766d14aeeba713188c744156dbe1e0a | 026a5f8d3af3eadc1de72cc4ac80266daa960653 | GLP90/cmssw | /DataFormats/PatCandidates/src/PackedGenParticle.cc | C++ | cc | 4,876 | no_license | #include "DataFormats/PatCandidates/interface/PackedGenParticle.h"
#include "DataFormats/PatCandidates/interface/libminifloat.h"
#include "DataFormats/Math/interface/deltaPhi.h"
void pat::PackedGenParticle::pack(bool unpackAfterwards) {
packedPt_ = MiniFloatConverter::float32to16(p4_.Pt());
packedY_ = int... |
756a8908dd9d5fce883a6512eff63f3ba704ed72 | cdbb61ccda717b8057ed8edbc44ebdef16237131 | dmt3o/chromium | /chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc | C++ | cc | 5,022 | permissive | // Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/l... |
1f3e75979bc99256cbf116f82081513b71092c98 | 456a71674d22d84bb1f310f4d499e2bcf9016f15 | junction/jn-tapi | /OnSipCommon/Utils.cpp | C++ | cpp | 10,430 | no_license | #include "stdafx.h"
#include "Utils.h"
#include <time.h>
#include <sys\timeb.h>
#include <time.h>
#include <windows.h>
#include <string>
#include <vector>
#include <iterator>
#include <algorithm>
#include "logger.h"
#include "atlenc.h"
#include <assert.h>
using namespace std;
// Format the current t... |
a961d12f481d9ac06f1959cb5943d1b9ea2959a2 | 002c331d1fc741ce7c6e4c3302186a30f28a24c7 | wolvestotem/LeetCode | /Problems/394_decode string/not complete decode.cpp | C++ | cpp | 630 | no_license | #include"../leetcode.h"
class Solution {
public:
string decodeString(string s);
};
string Solution::decodeString(string s){
stack<char> ops;
string result;
for (int i=0; i<s.size(); i++){
if(s[i] == ']'){
string mi;
while(ops.top()!='['){
mi.insert(... |
8b2b0b19037b816fd6a207ba6fade51af75185d8 | 19df974290eb7b9b2dd3b34c8b6a5cde26b5579b | NoviceDuke/UVa | /UVa_11332.cpp | C++ | cpp | 460 | no_license | #include<iostream>
using namespace std ;
int calculate(int p)
{
int isum = 0 ;
while(p)
{
isum += p % 10 ;
p/=10 ;
}
return isum ;
}
int main()
{
int inumber , ianswer;
while( cin >> inumber && inumber != 0 )
{
if(inumber/10)
{
while(inumber/10)
{
ianswer = calculate ( ... |
d41b3fb4ffe2fa6b3e83c9617704286a55682500 | 3246b4040040072188059657b280b7ef6e6de6fd | amnesia4bygone/codeleet | /s/StrStr.cpp | C++ | cpp | 903 | no_license | class Solution {
public:
char *strStr(char *haystack, char *needle) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
// should negoticate
if (haystack ==NULL && needle == NULL)
return haystack;
if (haystack == NULL || needle... |
1c08c218a0acd2ffd28c006071145d967ecfd42e | 98f5d21c644b6b77db4448f474001c6cc2385b32 | tommylin001/pytorch | /aten/src/ATen/native/TensorIterator.cpp | C++ | cpp | 30,217 | permissive | #include <ATen/native/TensorIterator.h>
#include <array>
#include <ATen/ExpandUtils.h>
#include <ATen/Parallel.h>
#include <ATen/core/EnableNamedTensor.h>
#include <ATen/native/TypeProperties.h>
namespace at {
using DimMask = TensorIterator::DimMask;
using PtrVector = TensorIterator::PtrVector;
using loop_t = Tensor... |
663c65c1e35c9e6b7ba5e9f967d0e70768cc1aaa | cfe076c54abc69f5a9336277990d5311050d8300 | believe-that-23/random-practise | /A_Meximization.cpp | C++ | cpp | 1,212 | no_license | #include <bits/stdc++.h>
#include <cmath>
#include <regex>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ll long long
#define all(x) (x).begin(),(x).end()
#define vll vector<long long int>
using namespace std;
#define endl "\n"
ll C(ll n, ll k) {
double res = 1;
... |
616cfe2f708424120fcfc9b5d07310efad04e52d | 287d77c19e226fd7b30c6173cd66e45f67fa676e | Haamuprikaati/BattleTankUnrealCourse | /BattleTank/Source/BattleTank/Private/TankAimingComponent.cpp | C++ | cpp | 3,784 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "TankAimingComponent.h"
#include "TankBarrel.h"
#include "TankTurret.h"
#include "Projectile.h"
#include "Kismet/GameplayStatics.h"
// Sets default values for this component's properties
UTankAimingComponent::UTankAimingComponent... |
51e439c4865f0efba028cac0f838fa67309e19c6 | 80c656049fecd3c686143da8a1889f4883af5e59 | xxxmen/uesoft-AutoPFA | /AutoPFA/PageGeneralModel.cpp | C++ | cpp | 3,578 | no_license | // PageGeneralModel.cpp : implementation file
//
#include "stdafx.h"
#include "autopfa.h"
#include "pagegeneralmodel.h"
#include "General.h"
#include "CurveWrapper.h"
#include "DlgGenralCurve.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////... |
3dcb8a834a7edcae8a9fdb58cf7c2b24d8f9fa22 | b2a4feb610057212375c215aa97ac6551a1d81fb | GaloisInc/lean4 | /src/stage0/init/lean/compiler/ir/emitutil.cpp | C++ | cpp | 55,683 | permissive | // Lean compiler output
// Module: init.lean.compiler.ir.emitutil
// Imports: init.control.conditional init.lean.compiler.initattr init.lean.compiler.ir.compilerm
#include "runtime/object.h"
#include "runtime/apply.h"
typedef lean::object obj; typedef lean::usize usize;
typedef lean::uint8 uint8; typedef lean::ui... |
40134a392965c8e4b13edddb3bc54c2891b2a1f1 | 866357cbebb9d35535eedaf2e1afb55ed8ac3e7a | sunyanzighost/IanFirstGame | /Source/IanFirstGame/EnemySpawnBox.cpp | C++ | cpp | 1,381 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "EnemySpawnBox.h"
#include "Components/BoxComponent.h"
#include "Kismet/KismetMathLibrary.h"
#include "Enemy.h"
#include "Engine/World.h"
#include "AIController.h"
#include "BrainComponent.h"
#include "EnemyAIController.h"
#includ... |
bca8011209b62b088625d5cb04a5fcc822bf84cc | 5d81f3075b8c6215de62080077f6c3cb3cc430bf | LiamTyler/5607-hw2a-starter | /src/HW2a.cpp | C++ | cpp | 8,872 | permissive | // Skeleton code for hw2a
// Based on example code from: Interactive Computer Graphics: A Top-Down Approach with Shader-Based OpenGL (6th Edition), by Ed Angel
#include "glad/glad.h"
#include "GLFW/glfw3.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <sstream>
// This file... |
3722523ce89f231bf23408cc0f197446e069f39b | 3d4a516c0a4f7536ba498493fc4614a0944bc420 | brunolauze/openpegasus-providers | /src/Providers/UNIXProviders/ListsInRoutingPolicy/UNIX_ListsInRoutingPolicy_DARWIN.hxx | C++ | hxx | 1,826 | permissive | //%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor lice... |
13aa1b8fab000e5bfaccab7c2baa7d661f926bd4 | e67de58acbd73a15964ae03cad27c4d6ddc5eb2f | RetronixTechInc/android-retronix | /external/skia/tests/RecorderTest.cpp | C++ | cpp | 3,737 | permissive | /*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Test.h"
#include "SkPictureRecorder.h"
#include "SkRecord.h"
#include "SkRecorder.h"
#include "SkRecords.h"
#include "SkShader.h"
#include "SkSurface.h"
#define CO... |
d03970abea156d15ea950dac5fe29eabb28315dc | a77f61e85f4090e914e7b70fda0aba13ea04eb68 | meniossin/src | /third_party/skia/src/c/sk_surface.cpp | C++ | cpp | 16,073 | permissive | /*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkCanvas.h"
#include "SkData.h"
#include "SkImage.h"
#include "SkMaskFilter.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkPictureReco... |
6f6fb16b86995776fabe1bc13dd65002f5c3b6a5 | c6b9b76a2ba7fbee4994a1982b3ae02581a144be | ptylczynski/CPMax | /cpp/PCmax/pcmaxt.cpp | C++ | cpp | 3,351 | no_license | #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <chrono>
#include <cstdlib>
#include <fstream>
#define ZAKRES 100
int liczba_procesorow;
int liczba_zadan;
int index_min;
int* zadania;
int* procesory;
void printArray(int arr[], int size)
{
int i;
for (i = 0; i < size; i++)
... |
b5ccfdcdb7badd4e9820f2545a70687a29685646 | 5941220f7ad5514b03a5b94c6ac778ba634883cd | PayCoreProject/PayCore | /src/miner.cpp | C++ | cpp | 25,053 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2018 The Paycore developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYIN... |
c586bf80332e40b5edfebde944f4c3ce66025331 | 505fec122f5c88321142050664269e53ad924e7e | dskhudia/FBGEMM | /src/GenerateKernelU8S8S32ACC16Avx512.cc | C++ | cc | 12,296 | permissive | /*
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
*/
#include <iostream>
#include "GenerateKernel.h"
namespace fbgemm {
namespace x86 = asmjit::x86;
/**
*... |
572324306c2c51ea6f077aa545f448fc2c5bbe7f | 7cd7f8bda667b4205c16f0faefd945f9aaff65bd | lzk/nezha | /common/lld/common/linuxapi.cpp | C++ | cpp | 517 | no_license | #include <sys/statfs.h>
#include "log.h"
bool is_disk_no_space(const char* path ,unsigned int prefer_size)
{
struct statfs tmp_buf;
unsigned int t_space_size = prefer_size;
if(!statfs(path ,&tmp_buf)){
t_space_size = (((unsigned long long)tmp_buf.f_bavail * tmp_buf.f_bsize) >> 20);
// LOGLOG... |
87dddcba37b4a55dfedd2492926c2e9c6c1752f8 | 3092e012976468d3439f491b5773c0bb1154df66 | ausanyal/code | /cpp/num_combs_num_alpha.cpp | C++ | cpp | 1,553 | no_license | /*
Given a number print the number of combinations you can derive from the number.
1=A, 2=B, 26=Z, 0=+.
For example: 1123 can be represented by 1,1,2,3 which would stand for AABC.
Another representation - 11,23 - JW
Another representation - 1,1,23 - AAW
Another representation - 11,2,3 - JBC
For number 1123, there wil... |
592193421ff86b5ed7e1b15172bcf9dbdb3da1af | 89b22cd806c9bb68c45598c050e54088378bd959 | kdavison/cegui-mirror | /cegui/src/RendererModules/Ogre/ResourceProvider.cpp | C++ | cpp | 5,115 | permissive | /************************************************************************
created: 8/7/2004
author: James '_mental_' O'Sullivan
purpose: Implements Ogre specific ResourceProvider
*************************************************************************/
/*********************************************... |
d418152f3644c2aaa74cf4fcdcbd8804f8118ee5 | d1f362dcc995408e6c3f3834ff337f62a5f36fd9 | threepwo0d/GoldMiner | /gui/Button.cpp | C++ | cpp | 2,015 | no_license | /*
* Button.cpp
*
* Created on: 21.06.2014
* Author: Jonas
*/
#include "Button.h"
#include "io/InputManager.h"
#include <iostream>
#include <sstream>
using namespace std;
Button::Button(unsigned int id, Sprite* sprite, Vec2 position, Vec2 dimension):
Entity(sprite, position, dimension),
id_(id),
isHove... |
14bb7b8b05eee4e123c4d464c892613feba26156 | 6b60819fdbeccc33081e0769c10e582f3191e15a | ric2b/Vivaldi-browser | /chromium/ui/views/widget/root_view_unittest.cc | C++ | cc | 38,989 | permissive | // Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/views/widget/root_view.h"
#include <memory>
#include <utility>
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"... |
1d66a9094d096968014dc609c88b23354151c311 | 53db48cf61265a2929abb8b8ae6d1f4bc38e1ebf | timblechmann/nt2 | /modules/core/bitwise/unit/scalar/rol.cpp | C++ | cpp | 2,228 | permissive | //==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// ... |
c0d7b6fe74beeeeafaa787897990df4bde2f3ec2 | 5efce084462e1f1d210bad0897aaacee96e80a67 | evshary/iceoryx | /iceoryx_binding_c/source/c_subscriber.cpp | C++ | cpp | 4,458 | permissive | // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required... |
77cd8b79e8df5b82a0c08198c1493e6a63aa94d7 | 5cf92f0493c3ee919509ca88b3370d7aac0f294d | Michael0ne/TOD_tools | /TOD1/StringsPool.cpp | C++ | cpp | 5,451 | no_license | #include "StringsPool.h"
String::String(const char* const str)
{
m_Length = strlen(str);
m_Flags = (STRING_BITMASK_DEFAULT ^ (m_Length + (m_Length >> 2))) & STRING_BITMASK_ONLY_SIZE ^ STRING_BITMASK_DEFAULT;
m_Str = &m_ShortStr;
m_ShortStr = NULL;
if (m_Length == NULL)
return;
if (m_L... |
f317b38c141d38fbe8116a0eff2df5c552da5cab | 3d4d2b00241c4b9f72db6d6397c2430c0d6a5910 | sethk/PixAccCurvedSurf | /Sources/GLFWApp.hh | C++ | hh | 7,973 | no_license | #pragma once
#ifdef USE_GLEW
#include <GL/glew.h>
#elif defined(USE_GL3W)
#include <GL/gl3w.h>
#else
#error Missing GL extension loader
#endif // USE_GL3W
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include <stdexcept>
#include <iostream>
#include <memory>
#include <sstream>
#include "imgui_raii.h"
#inc... |
9e784b909a74b308d766ce22ebaa315c69435a46 | abf96f5840aa59df2908f8fdce90053fe4331dc0 | ole00/Main_MiSTer | /DiskImage.cpp | C++ | cpp | 128,273 | no_license | #include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "DiskImage.h"
#include "file_io.h"
#define ERR_OPEN "Error: can't open source file"
#define ERR_GETLEN "Error: can't get file length!"
#define ERR_NOMEM ... |
8b06c9aeeb706a1002f29454463cfa0dca13b298 | 1b1c15c328749983f7b252f6d9d57edbdaf72233 | breezealexis/taichi | /taichi/transforms/compile_to_offloads.cpp | C++ | cpp | 3,116 | permissive | #include "taichi/ir/ir.h"
#include "taichi/ir/transforms.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/visitors.h"
TLANG_NAMESPACE_BEGIN
namespace irpass {
void compile_to_offloads(IRNode *ir,
const CompileConfig &config,
bool vectorize,
... |
329786fa7712326fdadd0d4300ce3b08d9375e93 | c3eb343ae07fd77f95d5fe33a32af54b9f2c32a1 | fffcraig/KSJApiNew | /KSJ_Calibration/KSJPreviewThread.cpp | C++ | cpp | 2,623 | no_license | #include "KSJPreviewThread.h"
#include "KSJApi.h"
#include <QMutex>
#include "KSJRemap.h"
CKSJPreviewThread::CKSJPreviewThread(QMutex *bufmutex)
{
int nRet = 0;
m_bIsrunning = 1;
m_nWidth = 0;
m_nHeight =0;
m_nBitCount =0;
m_pMutex = bufmutex;
m_bCalibration = false;
m_pMapX = 0;
m_p... |
b505ccf7f426259a64273f0ad57ed598a0ebaf6d | c6ed43a2dfae4cea1096b69daa1d324ee79abd76 | aszrul/anope | /modules/hostserv/off.cpp | C++ | cpp | 1,929 | no_license | /*
* Anope IRC Services
*
* Copyright (C) 2003-2017 Anope Team <team@anope.org>
*
* This file is part of Anope. Anope 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, version 2.
*
* This program is ... |
1c73184b79550e5e1c34bb6bd7e8d2d0a1fcf2a0 | 11e0c87405a393523296092927a5f21c4994bdf8 | tayloryoung6396/FYP | /src/shared/utility/io/gpio.cpp | C++ | cpp | 4,156 | permissive | #include "gpio.hpp"
#include "gpio.h"
extern "C" {
void MX_GPIO_Init(void) {
GPIO_InitTypeDef GPIO_InitStruct = {0};
// GPIO Ports Clock Enable
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GP... |
2c5bb1e2ad3aca2c9c12ca961137d1f6c3e336bc | 799d0eb1638f29e3202aacec61b683272400889e | hajeongyeon/Algorithm | /DP/boj10844.cpp | C++ | cpp | 514 | no_license | #include <iostream>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int N;
cin >> N;
int arr[101][10] = { 0, };
for (int i = 1; i <= 9; ++i) arr[1][i] = 1;
for (int i = 2; i <= N; ++i)
{
arr[i][0] = arr[i - 1][1];
for (int j = 1; j <= 8; ++j) arr[i][j] = (arr[... |
71e10fe65bb8f63c4dfb389310d6a2f7d079e24e | eabef05424f2bd0eee7825cc35cd704964180afa | blockspacer/destructionderby | /Code/Environment/Tornado.cpp | C++ | cpp | 14,779 | no_license | #include "StdAfx.h"
#include "Tornado.h"
#include "../Game.h"
#include "../Actor.h"
#include "Environment/FlowTornado.h"
#include <IMaterialEffects.h>
#include <IEffectSystem.h>
#include <IVehicleSystem.h>
#include <IRenderAuxGeom.h>
//-----------------------------------------------------------------------... |
fc8df1b22512752b0a530c6e43752bcb9cd5c10b | 3e7c2a00fa7339235a278aab0b51a83dbacfe630 | salonigupta1/Codeforces | /codeforces/486/B.cpp | C++ | cpp | 1,373 | no_license | #include<iostream>
using namespace std;
#define OJ \
freopen("input.txt", "r", stdin); \
freopen("output.txt", "w", stdout);
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main()
{
//OJ;
int n, m;
cin >> m >> n;
bool B[m][n], A[m][n], C[m][n];
for (int i =... |
41dba254811a66d0c5ff2a362b7de867ad00a486 | 18426d76b532e55e8e09ee74f0e587492d981601 | ProPoint/RickCoin | /src/rpcdump.cpp | C++ | cpp | 2,708 | permissive | // Copyright (c) 2009-2012 Bitcoin Developers
// Copyright (c) 2011-2012 Litecoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "init.h" // for pwalletMain
#include "bitcoinrpc.h"
#include "ui_interface... |
58f3c7f811c735b9013543ea709e2c8d1ccc5b5c | 8b30ba14bd8feb4e0c034e1e1d9100e69e74ec0d | nahid0335/Problem-solving | /uva/10110.cpp | C++ | cpp | 373 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
long long int n,i,j,x;
while(cin>>n)
{
if(n==0)
break;
x=sqrt(n);
if(x*x==n)
{
cout<<"yes"<<endl;
}
else... |
45e0164e8b9de410850e48944ddb6ac0f2f51b0f | f2c1950ae5b09f65ba25356ff744dbc3e6156180 | yular/CC--InterviewProblem | /LeetCode/leetcode_recover-a-tree-from-preorder-traversal.cpp | C++ | cpp | 1,642 | no_license | /*
*
* Tag: Data Structure (Stack)
* Time: O(n)
* Space: O(n)
*/
/**
* 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 {
public:
TreeNode* recoverFromPreorder... |
cbfb0b79e2d0ee9c3b07014c7f87546ee71ec8f9 | 35121c2bdf4d44c0d0d797605423b0d9d0596e3e | bakerstu/openmrn | /src/utils/ClientConnection.hxx | C++ | hxx | 7,386 | permissive | /** \copyright
* Copyright (c) 2016, Balazs Racz
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this li... |
b8d31ee1c16adccd2c001648cc28d180de853d77 | 6ed5ece401a38d66767986319e0c10ff9fc3dd84 | SecretsOTheP/d912pxy | /d912pxy/d912pxy_shader_replacer.cpp | C++ | cpp | 10,094 | permissive | /*
MIT License
Copyright(c) 2018-2019 megai2
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, dist... |
7fe4530baaa48945a97f03801e0c3c800241043f | a5688e101056048ab5b4e319619cd08f9a001fd3 | nwjs/chromium.src | /chrome/browser/web_applications/commands/callback_command.cc | C++ | cc | 2,827 | permissive | // Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/web_applications/commands/callback_command.h"
#include <memory>
#include <utility>
#include "base/functional/callback_helpers.h"
#include "base/strin... |
2f40fbbdbc105b213c6286fb3af640dd6dd9cba6 | 37d66591a9f40fcaeeacd5a30ec5ad1d8391a715 | bebol/libcod | /declarations.hpp | C++ | hpp | 59,402 | no_license | #ifndef _DECLARATIONS_HPP_
#define _DECLARATIONS_HPP_
#include <stdint.h>
#define qboolean int
#define qtrue 1
#define qfalse 0
#define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])
#define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
#defi... |
6b1508e70de37081c09058fe4088497cf65b0796 | c495263f02d66324a1b57e879826b85e2aa8c70b | david7482/gpb | /main.cpp | C++ | cpp | 3,226 | no_license | #include <iostream>
#include "proto/test0.pb.h"
using namespace std;
int main()
{
// Verify that the version of the library that we linked against is
// compatible with the version of the headers we compiled against.
GOOGLE_PROTOBUF_VERIFY_VERSION;
tutorial::AddressBook addressBookWrite;
auto pe... |
c24099469a794dc234b6ba6062b5bab47c48c459 | b105e999659a1441d80c67929ca02165d0e5fb88 | kailaisi/android-29-framwork | /compile/mclinker/lib/Support/MemoryAreaFactory.cpp | C++ | cpp | 2,300 | permissive | //===- MemoryAreaFactory.cpp ----------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------------... |
5611994303edec738fce4a3d6c2c934e88ea2f2d | f21d669ca4cc81c22e0be1d6063b4087cd473e80 | Akv2021/DS-Algo | /Basic/decimalToOctal-hackerblocks.cpp | C++ | cpp | 327 | no_license | #include<bits/stdc++.h>
using namespace std;
int decimalToOctal(int n)
{
int octal = 0;
int rem, i = 1;
while (n != 0){
rem = n % 8;
octal += rem * i;
i *= 10;
n /= 8;
}
return octal;
}
int main() {
int n;
cin>>n;
cout<<decimalToOctal(n);
retu... |
e35a81402502a8d557a307ef51f8b244346ac340 | 87714cd31adb7fdd10201385e3c2a283a750276b | charles-pku-2013/CodeRes_Cpp | /TICPP-2nd-ed-Vol-two/code/C07/Stack1.cpp | C++ | cpp | 1,031 | no_license | //: C07:Stack1.cpp
// From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison.
// (c) 1995-2004 MindView, Inc. All Rights Reserved.
// See source code use permissions stated in the file 'License.txt',
// distributed with the code package available at www.MindView.net.
// Demonstrates the STL stack.
#incl... |
7831f166bcbe25b49372c4f2e50681e2c18c6043 | 9430946c19b122e8e644d826b2523e3a838fce1e | kissdavid1017/ch9-drill | /ch9drill4.cpp | C++ | cpp | 1,333 | no_license | #include <std_lib_facilities.h>
using namespace std;
enum class Month
{jan=1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec};
class Year { // year in [min:max) range
static const int min = 1800;
static const int max = 2200;
pub... |
d2fc0e1d9c568f334a2b99e8c9bf3765091e0384 | e4eabbc3dbac789fddb330158b0ffa5a17eda126 | Rahat-Khan-Pathan/UVA-Solutions | /11044 - Searching for Nessy.cpp | C++ | cpp | 857 | no_license | /*
||-----------------------------------||
|| Rahat Khan Pathan ||
|| BGC Trust University ||
|| Department of CSE ||
||-----------------------------------||
*/
#include<bits/stdc++.h>
#define ll long long int
#define pub push_back
#define PI 3.14159265359
#define... |
76615cbf33d0a13263d85218dc63e01f49a2e89f | 680646413eec95dced70e6d4d4fdfd7286761b4a | skyline75489/leetcode | /sum-numbers.cpp | C++ | cpp | 331 | no_license | int dfs(TreeNode *root, int sum);
int dfs(TreeNode *root, int sum) {
if (!root) {
return 0;
}
if (isLeaf(root)) {
return sum * 10 + root->val;
}
return dfs(root->left, sum * 10 + root->val) + dfs(root->right, sum * 10 + root->val);
}
int sumNumbers(TreeNode *root) {
return dfs(r... |
4d3ae30925536559230885e16b9e5852845202aa | 7dbe8ab0b2b7ee6a57c8b6b6c9426c09966eb2af | diasurgical/scalpel | /psx/_dump_/54/_dump_c_src_/diabpsx/source/storm.cpp | C++ | cpp | 359 | permissive | // C:\diabpsx\SOURCE\STORM.CPP
#include "types.h"
// address: 0x80073628
// line start: 63
// line end: 64
void *SMemAlloc(unsigned long bytes, char *filename, int linenumber, unsigned long flags) {
}
// address: 0x80073648
// line start: 74
// line end: 76
unsigned char SMemFree(void *ptr, char *filename, int ... |
6cab0fa0d884e8f0543ce914f44bb51334d77930 | 06169a877853521829e8f29044e0975519f55a05 | qnux/ard2017 | /robot/Common/1_RSP/core/ArdMaths.cpp | C++ | cpp | 1,927 | no_license | /*
* ArdMaths.cpp
*
* Created on: 9 nov. 2016
* Author: wix
*/
#include "ArdMaths.h"
#include "ArdFramework.h"
#include "wiring_constants.h"
using namespace ard;
float ard::moduloPiPi(float a)
{
if (a <= -M_PI)
return a + 2 * M_PI;
else if (a > M_PI)
return a - 2 * M_PI;
else
... |
a4364930db5cc5273f3e59ea2ca50d5b05b676fa | ded3cc71618af68a14f0b0f2b35f457b79778e64 | mgaona909/Final-Project | /Final_Project/Computer.cpp | C++ | cpp | 457 | no_license | #include "Computer.h"
Computer::Computer(int s) : Player(s)
{
randomRow = 0;
randomCol = 0;
}
void Computer::setRandomRow()
{
randomRow = rand()%10;
}
int Computer::getRandomRow()
{
return randomRow;
}
void Computer::setRandomCol()
{
randomCol = rand()%10;
}
int Computer::getRandomCol()
{
r... |
805742774b104c7aad631d7dcd0685cc33547d8b | e52d8e652fb05b6dfa83c39be2e802f61d4656e2 | tttangjie/CompetitionCoding | /取石子(一).cpp | C++ | cpp | 341 | no_license | #include<stdio.h>
//a先取走n%(m+1)个
//b无论取(1~m)个中哪一个数
//a总能补齐m+1个 最后可以一次取走所有物品
int main()
{
int num,n,m; //n为石子总数,m为最多取的个数
scanf("%d",&num);
while(num--){
scanf("%d%d",&n,&m);
if(n%(m+1) == 0)
puts("Lose");
else
puts("Win");
}
}
|
4da45c5f7553d839a88daeae1684dcc86af9f34a | 9f81bb428ef01edd82977a2d0636cbec6bf0b084 | adiego73/tesis-ardrone | /src/core/message/message_server.cpp | C++ | cpp | 2,936 | no_license | #include "core/message/message_server.hpp"
using namespace tesis;
MessageServer::MessageServer()
{
}
MessageServer::~MessageServer()
{
}
// Announce a topic
void MessageServer::announce( std::string topic )
{
boost::lock_guard<boost::mutex> lock( this->msg_mutex );
this->topic_map[topic] = "";
}
// Get a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.