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 |
|---|---|---|---|---|---|---|---|---|
88bcb6c4c5e11f140d9e859af84d989943d8493d | a21c53adbb28f83684c47e942a45d028d2c311fe | aaroncayabyab/2DGameEngine | /src/TextureManager.cpp | C++ | cpp | 462 | no_license | #include "./TextureManager.h"
SDL_Texture* TextureManager::loadTexture(const char* fileName) {
SDL_Surface* surface = IMG_Load(fileName);
SDL_Texture* texture = SDL_CreateTextureFromSurface(Game::renderer, surface);
SDL_FreeSurface(surface);
return texture;
}
void TextureManager::draw(SDL_Texture* te... |
9fa809ecaeea2c6da9907e95a8d44266a379a9a4 | 45feda0427b6eb5651fd53749e0fed8a354b909f | adzhou/oragle | /WebKit/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp | C++ | cpp | 3,733 | permissive | /*
* Copyright (C) Research In Motion Limited 2011. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) an... |
84a6349b9e6f7966b42b0688e91863d51d07a25d | b65ccd9c9306c92b6062575fa69e8f82a7aad373 | clubrobot/team-2017 | /arduino/common/Codewheel.cpp | C++ | cpp | 2,269 | no_license | #include <Arduino.h>
#include <EEPROM.h>
#include "Codewheel.h"
#include "SerialTalks.h"
void Codewheel::attachCounter(int XY, int AXIS, int SEL1, int SEL2, int OE, int RST)
{
m_COUNTER_AXIS = AXIS;
m_COUNTER_XY = XY;
m_COUNTER_SEL1 = SEL1;
m_COUNTER_SEL2 = SEL2;
m_COUNTER_OE = OE;
m_COUNTER_RST = RST;
p... |
22835d5bd0502959409255e121e71dc89654421e | 22faf7f5cd101ee78c03a181adffb3dc87fc3c24 | jindiaoke/FinChain-core | /libraries/app/application.cpp | C++ | cpp | 48,869 | permissive | /*
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
*
* The MIT License
*
* 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... |
911e9c242ca2e58efb2cb9de5c804d268b638e21 | 36bf7b1fd9fab3df82ececbe9a0ebc93ad85bafc | bdpdx/esp32-snippets | /cpp_utils/HttpServer.cpp | C++ | cpp | 6,461 | permissive | /*
* HttpServer.cpp
*
* Created on: Aug 30, 2017
* Author: kolban
*/
#include "HttpServer.h"
#include "SockServ.h"
#include "Task.h"
#include <esp_log.h>
#include "HttpRequest.h"
#include "HttpResponse.h"
#include "WebSocket.h"
static const char* LOG_TAG = "HttpServer";
/**
* Constructor for HTTP Server
... |
d4120b4013d41646292b04ead5ef964a231a2a86 | 6f5f3761e40177f6c72974534eced2888c8a01f4 | netpyoung/bs.introduction-to-shader-programming | /directx/ch03/ShaderFramework.cpp | C++ | cpp | 10,401 | no_license | //**********************************************************************
//
// ShaderFramework.cpp
//
// 쉐이더 데모를 위한 C스타일의 초간단 프레임워크입니다.
// (실제 게임을 코딩하실 때는 절대 이렇게 프레임워크를
// 작성하시면 안됩니다. -_-)
//
// Author: Pope Kim
//
//**********************************************************************
#include "ShaderFramework.h"
... |
420b64fce7e6f337acab21d70c2503df7e761504 | 5639837c32afdfd16d353c584ccd4f60ac68c25d | asunan9sha/chess | /src/ui/basicbutton.cpp | C++ | cpp | 1,776 | permissive | #include "basicbutton.hpp"
#include "resources/resourceholder.hpp"
#include <utility>
#include "renderers/masterrenderer.hpp"
ui::BasicButton::BasicButton(const std::string_view &string, const sf::Vector2f &size, const sf::Texture &texture,
std::function<void()> function) :
function_(st... |
0738f90ab2f95838dbd1219d9c2c8572ea4c568b | f949532fed1c7ed52ba216373f00c76d26fa29cb | 0000duck/hpp_source_code | /install/include/hpp/wholebody-step/config.hh | C++ | hh | 3,619 | no_license | // Copyright (C) 2008-2018 LAAS-CNRS, JRL AIST-CNRS, INRIA.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions a... |
80043e138da80568bb72a4860dc0c09193492c46 | d7ab9880ff126d0825c6710d4cd88efa20a9d03d | laien529/chromium | /chrome/browser/chromeos/scanning/lorgnette_scanner_manager_unittest.cc | C++ | cc | 12,837 | permissive | // Copyright 2020 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/chromeos/scanning/lorgnette_scanner_manager.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#includ... |
3fd8b803eb326880d92ddca6ae0445f7622bc6e5 | cf7c1af9cca7520200747f933b4529ee7499d48f | dilingsong/mindspore | /mindspore/ccsrc/backend/kernel_compiler/kernel_build_info.cc | C++ | cc | 9,367 | permissive | /**
* Copyright 2019 Huawei Technologies Co., Ltd
*
* 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... |
979d43ae7f631feedc42ce2c105ae206662da85a | afcf7c2dad3d0bfbe982bb547a6a251ab2b04b41 | maiconcv/dropbox-simulator | /utils/source/File.cpp | C++ | cpp | 227 | no_license | #include "../include/File.h"
File::File() = default;
string File::getName()
{
return descriptor.name;
}
int File::getSize()
{
return descriptor.size;
}
fileDescriptor File::getDescriptor()
{
return descriptor;
} |
9c17e3df502efaf91c1394b5add737b7eed516ea | 731573dbbcc367cbe086b1d2abd0ba6e98213332 | lucasbc/MuonAnalysis-TagAndProbe | /plugins/InefficiencyCreator.cc | C++ | cc | 5,562 | no_license | // -*- C++ -*-
//
// Package: InefficiencyCreator
// Class: InefficiencyCreator
//
/**\class InefficiencyCreator InefficiencyCreator.cc MuonAnalysis/TagAndProbe/src/InefficiencyCreator.cc
Description: <one line class summary>
Implementation:
<Notes on implementation>
*/
//
// Original Author: Nov 16 ... |
7b84c00405706f31a2bb2aaadb6f4ee54ab8dddb | 7e7ad502203cd4295783d836989562d900e7fc84 | abcdls0905/PanaEngine | /PanaEngine/fm_render/stencil_tex.cpp | C++ | cpp | 3,456 | no_license | #include "stencil_tex.h"
#include "render.h"
#include "../public/core_log.h"
#include "../public/core_mem.h"
#include "../visual/vis_utils.h"
CStencilTex::CStencilTex(Render* pRender,unsigned int width, unsigned int height, TEX_FORMAT format,int type)
{
m_nRenderTex = 0;
m_pRender = pRender;
m_nFormat = f... |
5ce449dce07e8e2c9192b0a8358111dd836cb6a0 | 5a832bc5fadce3c338204829fedb593c1eea6391 | Tiefseetauchner/chromium | /chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc | C++ | cc | 25,385 | permissive | // Copyright 2020 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/nearby_sharing/nearby_sharing_service_impl.h"
#include <utility>
#include "base/bind.h"
#include "base/task_runner_util.h"
#inc... |
e350de5d133c7e25df9ec24cdd003e29203122d8 | 21f50a397e2ae2ee0cb0ec6b8f7c44059d3de403 | AcuteAngleCloud/Acute-Angle-Chain | /contracts/libc++/upstream/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp | C++ | cpp | 4,052 | permissive | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------... |
c00c58449ca1ce7739d182693497d427a78aee75 | 953f79433250327ddf2042e8546dcf4616973224 | dongdong-2009/uukit | /udp/embedMode/server/server.cpp | C++ | cpp | 3,731 | no_license | //date 11.8 by gong
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <unistd.h>
#include <string>
#define BUFSIZE 1024
#include <i... |
ca3d81ff6524c80f02ac641c80ab578972efccbe | e0258a8dd262499954eb08b1e56e33fc0ed32846 | open-gunz/ref-jur13n-gunz1.5 | /CSCommon/Source/MQuestScenario.cpp | C++ | cpp | 20,372 | no_license | #include "stdafx.h"
#include "MQuestScenario.h"
#include "MQuestFormula.h"
#include "MZFileSystem.h"
#include "stdlib.h"
MQuestScenarioCatalogue::MQuestScenarioCatalogue()
{
m_nDefaultStandardScenarioID = CalcStandardScenarioID(0, 0);
}
MQuestScenarioCatalogue::~MQuestScenarioCatalogue()
{
Clear();
}
MQuestScenar... |
0636d43558d5a4e5d401d746a29e59ae59dbc1e1 | 4e8585a863023ce01da64d3d49bd49dcc6857dab | Sitispeaks/turicreate | /src/external/boost/boost_1_68_0/boost/vmd/tuple/remove.hpp | C++ | hpp | 2,511 | permissive |
// (C) Copyright Edward Diener 2015
// 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).
#if !defined(BOOST_VMD_TUPLE_REMOVE_HPP)
#define BOOST_VMD_TUPLE_REMOVE_HPP
#include <bo... |
edfd3f204ca8f2bb745878bb58add63710e1950a | f615efc7a6b702c67ea92e65aecd987ffda92f10 | aymanmostafa/UVA-11239---Open-Source-solution | /UVA 11239 - Open Source solution.cpp | C++ | cpp | 2,191 | no_license | //============================================================================
// Name : ayman.cpp
// Author : Ayman Mostafa
// Email : ayman93live@hotmail.com
// Version : v5.0
//============================================================================
#include <cstring>
#include <map>
#inclu... |
90a7e78353cd085aba5b63bfb524b6505ea5475c | 07fd784a65fa2e53c3b84f890a39ac217b96b713 | soaresfabricio/PacManX | /include/Jogador.hpp | C++ | hpp | 1,249 | permissive | //
// Jogador.hpp
// PacManX
//
// Created by Fabrício Soares on 03/11/16.
// Copyright © 2016 Fabrício, Yooh e Wesnydy. All rights reserved.
//
#pragma once
#define M_PI 3.14159265358979323846
#include "headers.hpp"
#include <stdio.h>
#include <math.h>
#include <map>
#include "Eventos.hpp"
#include "Direcao.hpp"... |
d5e2b4f22f6ffde3e3fd15ff8a4014264a9892e4 | 5b8c5829245a3fd28a49b8fc72fb8700753562db | aws/aws-sdk-cpp | /generated/src/aws-cpp-sdk-connect/source/model/ContactState.cpp | C++ | cpp | 3,799 | permissive | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/connect/model/ContactState.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
... |
617ff8f38ce771d83c5a4b92923f05cc73637f07 | d1f9f7a2500b58bb7e5c9c9e2ef3ebafa65214d4 | gurjotsingh4398/Leetcode-solution | /701. Insert into a Binary Search Tree.cpp | C++ | cpp | 980 | no_license | // https://leetcode.com/problems/insert-into-a-binary-search-tree/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
static int speedup=[](){
ios_base::sync_with_stdio(f... |
2be321bfabc3f1ee35daa4a52f4eabfdf3cc35ff | 212ef7294f4c4829c8dce0b4ed330f97600aa7cb | Tigrouzen/UnrealEngine-4 | /Engine/Source/Developer/MeshBoneReduction/Private/MeshBoneReduction.cpp | C++ | cpp | 9,570 | no_license | // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "Engine.h"
#include "MeshBoneReduction.h"
#include "Developer/MeshUtilities/Public/MeshUtilities.h"
class FMeshBoneReductionModule : public IMeshBoneReductionModule
{
public:
// IModuleInterface interface.
virtual void StartupModule() OVERRIDE;
... |
d588c9bdf1a88a89347b37a9480383e3b8800718 | 59c4a599283bb87b1f31a195e91bb89a23fcb89f | happyabbi/OWdc | /Source/OWDC/04tc01.cpp | C++ | cpp | 50,868 | no_license | // 04tc01.cpp
//
//Creado: Luis Capriles, Fecha: 16/10/2012
//Modificado: Luis Capriles, Fecha: 16/10/2012 - Descripción y UM ...
//Modificado: Luis Capriles, Fecha: 05/11/2012 - Manejo de multiples ini, varios LOCATION ...
//Modificado: Luis Capriles, Fecha: 03/07/2013 - Manejo de MCU Principal ...
//Modificado:... |
ec170a5f8b3c83889a3b5a659ba71221b695acfc | d7fe2b97f73a290e9c58e07306691fd91b67926a | atrin-hojjat/CompetetiveProgramingCodes | /CF/EdRound_73/B.cpp | C++ | cpp | 220 | no_license | #include <iostream>
using namespace std;
int main() {
int n; cin >> n;
char cl[2] = {'W', 'B'};
for(int i = 0; i < n; i++, cout << endl)
for(int j = 0; j < n; j++)
cout << cl[(i + j) % 2];
return 0;
}
|
e5d9239acc7731c9d0908a6c5d13e4c3e83d57f2 | 6485511ec711e2ee10cf1f3966bd0ac21cbe8ac3 | poojagarg/Coding | /c,c++/spoj/mchaos.cpp | C++ | cpp | 1,188 | no_license | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cstdio>
using namespace std;
char a[100000][11];
char rev[100000][11];
bool cmp1(int i, int j){
if(strcmp(a[i],a[j])<0)
return true;
else
return false;
}
bool cmp2(int i, int j){
if(strcmp(rev[i],rev[j])<0)
return ... |
fff03d71e920ae6f139efbe82f58b1c68086e2eb | c81a3a01f58bb2b2d4ec62ca7d9cfeb5dd37ccd6 | generalova-kate/openvino | /ngraph/frontend/frontend_manager/include/frontend_manager/place.hpp | C++ | hpp | 13,187 | permissive | // Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <memory>
#include <string>
#include <vector>
#include "frontend_manager_defs.hpp"
namespace ngraph {
namespace frontend {
/// \brief An interface for identifying a place in a graph and iterate over it; can r... |
b4d9c8343187ea818747ea728fb9a9ac10cf6def | 767d7525a6654bc2dd8dc749c3688470235a3d0f | Wallet-Secure/Wallet-Secure | /Wallet-Secure/src/init.cpp | C++ | cpp | 42,819 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "txdb.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "net.h"
#... |
bd52d7e07063fefd120e2917b388c91e2a628c2a | 7739d4dad11778d34858b57c6995f48a9ca51742 | snjumaheshwari/C-Cpp | /Graphs_adj_list.cpp | C++ | cpp | 2,822 | no_license | #include<list>
#include<iostream>
#include<queue>
#include<map>
using namespace std;
class Graph{
int N; // denotes no of vertices.. i,e. vertices are numbered 0 to N-1.
list <int>*adjList;
public:
Graph(int n)
{
N=n;
adjList= new list<int>[N];
}
void addEdge(int u, in... |
6df6d30e961a3ae426128a9d647764cb6afa9e19 | fecb86f2ee037bf1eaa506b5b23734c3427802ab | AliciaWalker01/MindPalaceLite | /NonProjectExamples/OnlineAssessment.cpp | C++ | cpp | 4,592 | no_license | // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <string>
#include <vector>
#include <windows.h>
#include <cctype>
using namespace ::std;
int StringComp(string input, int index)
{
if (input.l... |
9e301fb0737d41d450d145eb64f5e838915449fa | 2cf56131818448be650f000e1bbb1c1470913f74 | newts7/Online_Judge_Solutions | /codeforces/686/B[ Little Robber Girl's Zoo ].cpp | C++ | cpp | 26,766 | no_license | head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="X-Csrf-Token" content="6db4047c8f2657cdec35fe3e72a0f67f"/>
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=0.01"/>
<script type="text/javascript" src="http://st.codeforces.com/s/37239/js/... |
073031761fd67876c4d7805ed9a023ae9ea64198 | d4f000870b36b5b7f11aae8375d5c9cd95524925 | jasonulloa/ITP485-2017 | /lab7/Source/Component.cpp | C++ | cpp | 427 | no_license | #include "ITPEnginePCH.h"
#include "Profiler.h"
IMPL_COMPONENT(Component, Object, 1);
Component::Component(Actor& owner)
:mOwner(owner)
{
}
Component::~Component()
{
mOwner.GetGame().GetGameTimers().ClearAllTimers(this);
}
void Component::Tick(float deltaTime)
{
}
void Component::Register()
{
}
void Component... |
f5a26ae8de492d7b0d14b0fa1fc9248916b0e5c8 | 262e95e258e96a855ca4eb14cf2655e64ee314e7 | horiuchikouta/stm32f103_hori | /HORI/stm32f10x_base/usart.hpp | C++ | hpp | 1,496 | no_license | #ifndef USART_HPP_
#define USART_HPP_
#include <stdarg.h>
#include <stdio.h>
#include "stm32f10x.h"
#include "util.hpp"
#define USART_DEFAULT_BAUD 115200
#define USART_RX_BUFFER_SIZE 256
#define USART_TX_BUFFER_SIZE 256
class Usart{
public:
//setup--------------------------
void init();
Usart();
Usart(GPIO_Type... |
3bade821ed850eaea1c389405dc75a0a5364c462 | 68325bba03528002d7f3f4a0e06c38c86eeec5fe | Exstream-OpenSource/Chromium | /services/ui/public/cpp/window.cc | C++ | cc | 30,225 | 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 "services/ui/public/cpp/window.h"
#include <stddef.h>
#include <stdint.h>
#include <set>
#include <string>
#include "base/bind.h"
#include "ba... |
c1e8eada3c80311187cfa79e9d5822cc91bd4683 | 0df52dfefb0404e47e43269d26d288be1419f54a | ITgenerat0r/coursera | /week4/students.cpp | C++ | cpp | 1,029 | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
struct Student {
string name;
string last_name;
int day;
int month;
int year;
};
int main() {
int n;
cin >> n;
string name, last_name;
int day, month, year;
vector<Student> students;
for (size_t i = 0; i < n; ++i) {... |
1d383fc6a45b88ab92e1eddcca0fb4e6e7fb621d | 3c9e4464788bc524774bdc3f6fd632ab16cd5b11 | dhruvshrinet1/git_prac | /detect_cycle.cpp | C++ | cpp | 877 | no_license | #include <bits/stdc++.h>
using namespace std;
bool detect_cycle(vector<int> adj[],bool visited[],int s,int parent)
{
visited[s]=1;
for(auto i:adj[s])
{
if(visited[i]==false)
{
if(detect_cycle(adj,visited,i,s))
{
return 1;
}
else if(i!=parent)
{
return 1;
}
}
}
return 0;
}
void ad... |
87785245f9cf2d4f904e6a042a454eb49b4db438 | f7bb825391d04b7e55fbc8763212ecbab5132370 | wwjiang007/bitshares-core | /libraries/plugins/snapshot/snapshot.cpp | C++ | cpp | 4,827 | permissive | /*
* Copyright (c) 2017 Peter Conrad, and contributors.
*
* The MIT License
*
* 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 righ... |
c706f69246669e92eece09a0381b456dc3cae173 | fd43e17918502019ca07dd6370ba52ebd5bff906 | jumperbeng/backup | /PDA/VTK-6.3.0/VTK-Release-build/Rendering/VolumeOpenGL/vtkGPUVolumeRayCastMapper_CompositeNoCroppingFS.cxx | C++ | cxx | 1,330 | permissive | /* DO NOT EDIT.
* Generated by ../../bin/vtkEncodeString-6.3
*
* Define the vtkGPUVolumeRayCastMapper_CompositeNoCroppingFS string.
*
* Generated from file: /home/jumper/Documents/PDA/VTK-6.3.0/Rendering/VolumeOpenGL/vtkGPUVolumeRayCastMapper_CompositeNoCroppingFS.glsl
*/
#include "vtkGPUVolumeRayCastMapper_Comp... |
45cea33d9f02bb87ba7f4d770d3ccf2d5480c0a6 | 69b424bcb8b9cb4856734150abb3979eb82ead4b | iishipatel/Competetive-Programming | /hr_Swap_Nodes_[Algo].cpp | C++ | cpp | 1,403 | no_license | /*
Author : Abhinav
Modified : 12-12-2017 07:01:57 PM
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
const ll mod = 1e9+7;
struct node{
int data;
int depth;
node *lc;
node *rc;
};
node *root = new node();
int ctr=0,t;
void create_tree(node* top){
int... |
ff6cf139ae92ac8c0418c030a1d1d70fd898b358 | ea71fff4290ec9d8fa1affe4f56aedfeb8dd0537 | utsaslab/crashmonkey | /code/tests/seq1/j-lang299.cpp | C++ | cpp | 3,938 | permissive | #include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <string>
#include <iostream>
#include <dirent.h>
#include <cstring>
#include <errno.h>
#include <attr/xattr.h>
#include "../BaseTestCase.h"
#include "../../user_tools/api/workload.h"
#include "../../user_tools/api/actions.h"
... |
0a8886ea6ea1823e6b8c87acb55bfb7bdcf9d4ea | d383f4b1464e859cc21f1da70cd50951d5b29a93 | siddharthcurious/Coding | /C++/array/max_drop_between_two_elements.cpp | C++ | cpp | 1,234 | no_license | //Given an array of integer, find the maximum drop between two array elements, given that second element comes after the first one.
//More generalized form of the problem where attempting to get the maximum a[m] - a[n] where m - n >= 1 instead of m - n == 1
#include <iostream>
using namespace std;
int maxDrop(int arr... |
2236f419ded2cc1eb4ae3bb27d29f715682f3dec | be8958000c30f453f4dbcf2783fc8a76fc3e0bab | int3/redex | /opt/interdex/InterDex.cpp | C++ | cpp | 36,455 | permissive | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "InterDex.h"
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <unordered_set>
#inclu... |
17b914ad28f55fe13f477524763b8b4468e2b82a | bfa1fcccfd4c7eb41cc29de5c1cffe7ce0281f01 | fjc-121427/LastJunior | /数据结构算法/一元多项式求积/一元多项式求积/源.cpp | C++ | cpp | 1,981 | no_license | #include<iostream>
using namespace std;
struct node {
int xishu;
int zhishu;
node* next;
node() {
next = NULL;
}
node(int x,int z) {
xishu = x;
zhishu = z;
next = NULL;
}
};
class LinkList {
private:
node * head;
int len;
public:
LinkList() {
head = new node();
len = 0;
}
... |
7ae9960c6c4a38f2a3910dc9784bff78fbf33151 | 90d54dea1fb81fd225e6ffb278c91ce09a6d7256 | aliparsai/obfsclient | /src/schwanenlied/crypto/hkdf_sha256_test.cc | C++ | cc | 6,339 | permissive | /*
* Copyright (c) 2014, Yawning Angel <yawning at schwanenlied dot me>
* 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... |
c55af2dbf0d8794f7d93eb3244675baee25f926e | 69f75090167e83c3cd1487d4dbe2dd73b5ea60ee | BourbonWarfare/bwmf | /Loadouts/Opfor/soviet_sks_m69.hpp | C++ | hpp | 15,207 | no_license | author = "AChesheireCat";
description = "Soviet Army c.1950";
#include "undef.hpp" // Reset defines
// ------------------- PASTE BELOW THIS LINE
// Camo set
#define CAMO_UNIFORM "cwr3_o_uniform_m1969","cwr3_o_uniform_m1969_collar","cwr3_o_uniform_m1969_rolled"
#define CAMO_VEST "cwr3_o_vest_harness_svd","vn_o_vest_v... |
d878b8ad740aa12deff195d3eb6b78fa88ab74fa | 7e9d726c5eb1e298f9941f40497fc359a9bc835a | terisikk/TravelAgency | /app/include/insert_travel_state.hpp | C++ | hpp | 571 | permissive | #ifndef INSERT_TRAVEL_STATE_HPP
#define INSERT_TRAVEL_STATE_HPP
#include <sstream>
#include "travelmapper.hpp"
#include "tsv/query.hpp"
#include "tsv/table.hpp"
#include "ui/context.hpp"
class InsertTravelState : public ui::State {
private:
tsv::Table* table = nullptr;
public:
explicit Inser... |
4dabbae0354a4087945bb65b97b21b0fc179f925 | c32669f66f817ddf11cdda10c2fb4d8f67696e3e | Amitmahato/Data-Structure-Algorithm | /Final BST Project.cpp | C++ | cpp | 7,248 | no_license | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
class notFound{};
class duplicateValue{};
struct node
{
int data ;
node* left;
node* right;
} ;
node * root,* par;
node* insertion(node * root,int d)
{
try
{
if(root==NULL)
{
... |
7f8a05a720fc00ff8aaf39902f08fb5e59393df9 | 811f36c3cc2759250e8a87f4fe6d0a2e58222b45 | Ewenwan/ow | /master-homework/AI/EX1.CPP | C++ | cpp | 9,752 | no_license |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define FREE 10
#define ASSIGNED 1
#define UNASSIGNED 0
#define EXIST 1
#define UNEXIST 0
#define NOTHING 10
#define TRUE 1
#define FALSE 0
#define RIGHT 1
#define FAULT 0
#define SUCCESS 1
... |
8fec27a00c0b3feb71ab3c342b9c6a314781a009 | 542c81cc2d5468d51909d2c009a47da392b532a3 | Brand-Temp/stlmp | /test/sorting/test_shell.cpp | C++ | cpp | 217 | permissive | #include "gtest/gtest.h"
#include "shell.hpp"
#include <bits/stdc++.h>
using namespace std;
TEST(shell_sort, all_tests){
int foo[] = {1, 5, 2, 3, 4};
shell_sort(5, foo);
ASSERT_EQ(foo[4], 5);
}
|
b642500cd3bb486b649e1ff397c2be973622f835 | 242d67a0f0de463ab3da3875adbf975fe6a688cd | lucasgmpaiva/Atividade_Heranca | /src/celular.cpp | C++ | cpp | 665 | no_license | #include "../include/celular.hpp"
Celular::Celular(string nome, double preco, string marca, string descricao, string dataFabricacao, string material, string durabilidade, string sistemaOperacional){
this->nome = nome;
this->preco = preco;
this->marca = marca;
this->descricao = descricao;
this->dataFabricacao = da... |
4d0ac5598d6ac34d108616267d15e0d67e1f99dd | e71e050649f82e6f522d0493eb96ae20f1990644 | wangxi0706/ParticleSystem | /src/particle.cpp | C++ | cpp | 838 | no_license | #include "particle.h"
Particle::Particle(Vec3 pos, Vec3 vel, float radius) :
position(pos),
velocity(vel),
radius(radius)
{ }
// Move this particle
void Particle::move()
{
// Add velocity to position, to get the new position
position = position + velocity;
}
bool Particle::collidesWith(Particle *other)
{
// Ge... |
7963fcc05b686e9dd0c0a9b9c8048c3b95aef1ed | 41dca5acfb89da022f82940dd983340c07a016a9 | Chanoian/OOP345 | /Game/src/main.cpp | C++ | cpp | 1,082 | no_license | #include<iostream>
#include<wchar.h>
#include <time.h>
using namespace std;
int cash = 100;
void Play(int bet)
{
//char c[3] = {'J','Q','K'};
char *c = new char[3];
c[0]='J';
c[1]='Q';
c[2]='K';
cout<<"Shuffling...";
srand(time(NULL));
int i;
for(i = 0; i< 5; i++)
{
int x... |
24d058ffba47a48f60e629688a8d3d0e4062b8dd | ae1d4839f7724269dfd1dd19ab867b770e7a3012 | davidtr1037/klee-pspa | /lib/Module/Optimize.cpp | C++ | cpp | 12,681 | permissive | // FIXME: This file is a bastard child of opt.cpp and llvm-ld's
// Optimize.cpp. This stuff should live in common code.
//===- Optimize.cpp - Optimize a complete program -------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Ill... |
6adc2543e9b5358d0921c7106d5f485d6d4c822b | fd09c9b46e5de4a5d6fec91d22d4c1b9ad3aa214 | CU-0xff/juliet-cpp | /000/082/637/CWE190_Integer_Overflow__int64_t_fscanf_multiply_84_bad.cpp | C++ | cpp | 1,499 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__int64_t_fscanf_multiply_84_bad.cpp
Label Definition File: CWE190_Integer_Overflow.label.xml
Template File: sources-sinks-84_bad.tmpl.cpp
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: fscanf Read data from the console using fscanf(... |
2fdad207b38628446fc50e6b9a10a0bd499ee75c | dc8815d6f8ec16b70f552333edca0cb81236d64b | ddrutnam/oop345 | /w6/Grades.cpp | C++ | cpp | 788 | no_license | #include "Grades.h"
#include <fstream>
using namespace std;
Grades::Grades(const char * filename)
{
try {
std::string line;
ifstream fp;
fp.open(filename);
if (!fp) throw exception("could not open file: ");
//get size of file
if (fp.is_open()) {
while (getline(fp, line, '\n')) {... |
17d7adbb08beef9410e4eb7daebeca75050af66b | 2ca1d38cdabc961fb5af3e059146d9054fbe7b3f | thun-cp/Problem-Solving | /codeforces/1375/A.cpp | C++ | cpp | 650 | no_license | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define endl '\n'
using namespace std;
typedef long long ll;
typedef long double ld;
void solve(){
ll n;
cin>>n;
ll arr[n];
for(ll i=0;i<n;i++) cin>>arr[i];
for(ll i=1;i<n;i++){
if((arr[i-1]>0&&arr[i]>0)||(arr[... |
886fe1298d0673923fb58326988b489697dc01e0 | f2dc46b654a74b68ea36a577866bdecf591f65d4 | CrackerCat/GravitGuard | /GravitGuard/base64.cpp | C++ | cpp | 3,173 | permissive | #include "pch.h"
#include <string>
#include "xorstr.h"
static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
static inline bool is_base64(unsigned char c) {
return (isalnum(c) || (c == '+') || (c == '/'));
}
std::string base64_encode(unsigned char const* b... |
fe25239194044575863099b863c0da1828603dc5 | 3b23a234d6411848b581af0c2701b4fbb4fc006b | JeppeNielsen/ECS | /ECS/Scripting/SystemComponentExtractor.hpp | C++ | hpp | 1,160 | no_license | //
// ScriptData.hpp
// PocketEditor
//
// Created by Jeppe Nielsen on 15/05/2017.
// Copyright © 2017 Jeppe Nielsen. All rights reserved.
//
#pragma once
#include <vector>
#include <string>
#include <functional>
namespace ECS {
class SystemComponentExtractor {
public:
bool Extract(const std::str... |
b1b3fed0f216c6df341a5d6ec8c919b603e0f184 | a8b127bc277b841b7c1ede9d8d29fed16c679815 | yizhendongfeng/ecl | /EKF/airspeed_fusion.cpp | C++ | cpp | 12,439 | permissive | /****************************************************************************
*
* Copyright (c) 2015 Estimation and Control Library (ECL). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
... |
38bcf4903f2189e8487617a8deedb561f42b718f | 26502f2eb4b0a600dad68b659fe09385dd0863fa | Buyduck/lldb | /source/Target/Thread.cpp | C++ | cpp | 85,941 | permissive | //===-- Thread.cpp ----------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
5e6e687a3785a30e8240d5f12946e667a9e9546c | 5e8881264e2bf6cf3d4ab3bd424ebf496ee6a5ea | jbitoniau/RiftOnThePi | /RiftOnThePi/RiftOnThePiApp.cpp | C++ | cpp | 25,218 | permissive | /*
Copyright (C) 2014 Jacques Menuet
This content is released under the MIT License (http://opensource.org/licenses/MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction... |
c72291f662ef13880983119ff13bc90f96b0277b | 08602633eab083655e3450aac46bffd50647fb2e | abufarhad/Codeforces-Problems-Solution | /617B Chocolate.cpp | C++ | cpp | 436 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long m,n,a[200],i,b,res=1;
cin>>n;
for(i=0; i<n; i++) cin>>a[i];
vector<int>v;
for(i=0; i<n; i++)
{
if(a[i] ==1)
{
v.push_back(i);
}
}
if(v.size()==0) cout<<"0"<<endl;
else
{
... |
4844b0bca98e166457d485bc0cd5939615976fb4 | 0327a29e7f9fcc1e9ac9102a3e5ae84e8d34977e | pebble2015/cpoi | /src/org/apache/poi/hssf/record/chart/DataFormatRecord.hpp | C++ | hpp | 2,108 | permissive | // Generated from /POI/java/org/apache/poi/hssf/record/chart/DataFormatRecord.java
#pragma once
#include <fwd-POI.hpp>
#include <java/lang/fwd-POI.hpp>
#include <org/apache/poi/hssf/record/fwd-POI.hpp>
#include <org/apache/poi/hssf/record/chart/fwd-POI.hpp>
#include <org/apache/poi/util/fwd-POI.hpp>
#include <org/apa... |
eabf6ec0608379d93e164eab1b54c6b06b3d93f1 | 9e3a40d44785215dd43bc16ef4edf58b0060d583 | soundac/SounDAC-Source | /libraries/plugins/auth_util/auth_util_plugin.cpp | C++ | cpp | 754 | permissive | #include <muse/chain/protocol/ext.hpp>
#include <muse/plugins/auth_util/auth_util_api.hpp>
#include <muse/plugins/auth_util/auth_util_plugin.hpp>
#include <string>
namespace muse { namespace plugin { namespace auth_util {
auth_util_plugin::auth_util_plugin() {}
auth_util_plugin::~auth_util_plugin() {}
std::string ... |
885ae8ea57a8f3ef0cafd1bae93c370f0c68e8c0 | 4dcfd66d17083fd83d2ca0830d4ee407caa7c236 | gems-uff/oceano | /core/src/test/resources/CPP/neopz/Frontal/TPZStackEqnStorage.cpp | C++ | cpp | 1,714 | permissive | /**
* @file
* @brief Contains the implementation of the TPZStackEqnStorage methods.
*/
#include "TPZStackEqnStorage.h"
#include "pzstack.h"
#include "pzfmatrix.h"
#include "pzreal.h"
#include <stdio.h>
using namespace std;
void TPZStackEqnStorage::SetBlockSize(){}
void TPZStackEqnStorage::ReOpen(){}
void TPZSta... |
ba861db286f73152555185e31d88936dd13a4d45 | 9648bfb384f8524f679644811dd680f5ab5a739a | qlb7707/pat | /basic/1001/main.cpp | C++ | cpp | 761 | no_license | /*================================================================
* Copyright (C) 2016 All rights reserved.
*
* filename :main.cpp
* author :qinlibin
* create date :2016/03/23
* mail :qin_libin@foxmail.com
*
================================================================*/
//#include "... |
c5afe6798234c8afe34f84797c3bc6ce90a302dc | 8ab2897ececd070c3add0666f3eff9774beb9ddb | aemior/code_train | /MOOC_CPP/mooc_029/main.cpp | C++ | cpp | 715 | no_license | #include <iostream>
#include <string>
using namespace std;
// 在此处补充你的代码
template<class T1>
T1* Filter(T1 *s, T1 *e, T1 *d, bool (*p)(T1)){
T1 *res = d;
for (int i=0; i<(e-s); ++i) {
if ((*p)(s[i])) {
*res = s[i];
++res;
}
}
return res;
}
bool LargerThan2(int n)
{
return n > 2;
}
bool LongerThan3(string s... |
a10a438992fc7bb432c3fc00357235dd687398f7 | 3a2f670c64a555815eb7bd756e7de44eb8c8ebd2 | aspose-slides/Aspose.Slides-for-C | /Examples/SlidesCPP/AnimationsOnOLEObject.cpp | C++ | cpp | 2,103 | permissive | #include "stdafx.h"
#include "SlidesExamples.h"
using namespace Aspose::Slides;
using namespace Animation;
using namespace System;
void AnimationsOnOLEObject()
{
// ExStart:AnimationsOnOLEObject
// The path to the documents directory.
const String outPath = u"../out/AnimationsOnOLEObject_out.pptx";
c... |
7d58c16ec807ae272343f0f91f0976c0e51e619f | 9a6d89e6daa584d39a94a5ef3bd5ed6dceac3eeb | igm-capstone/proto-03-remix | /Rig3D/GraphicsMath/Vector.cpp | C++ | cpp | 9,051 | no_license | #define _USE_MATH_DEFINES
#include <cmath>
#include "Vector.hpp"
using namespace cliqCity::graphicsMath;
// Vector2
float Vector2::magnitude2() const
{
return dot(*this, *this);
}
float Vector2::magnitude() const
{
return sqrtf(magnitude2());
}
// Compound Assignment (Vector2)
Vector2& Vector2::operator+=(const... |
7aaad5ef6da90819f9e3a17b41f336e415d69f37 | ce61ef3f37262deb27fc3afa22ccb36eb35a1dde | alkaidlong/PaperDemo | /Dev/Common/MedusaCore/Core/Pattern/RTTI/RTTIObject.cpp | C++ | cpp | 204 | no_license | #include "MedusaCorePreCompiled.h"
#include "Core/Pattern/RTTI/RTTIObject.h"
MEDUSA_BEGIN;
namespace Pattern
{
RTTIObject::~RTTIObject()
{
}
MEDUSA_IMPLEMENT_RTTI_ROOT(RTTIObject);
}
MEDUSA_END; |
418878fb373c27535811a379ff1e791f53240aed | 26833429edea08b1fdf14b945de851732204708a | chengwenwu/file | /charpter09/0916/test.cpp | C++ | cpp | 1,767 | no_license | #include <pthread.h>
#include <semaphore.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#define CUSTOMER_NUM 10
/* @Scene: 某行业营业厅同时只能服务两个顾客。
* 有多个顾客到来,每个顾客如果发现服务窗口已满,就等待,
* 如果有可用的服务窗口,就接受服务。 */
/* 将信号量定义为全局变量,方便多个线程共享 */
sem_t sem;
/* 每个线程要运行的例程 */
void * get_service(void *thread_id){
/* 注意:立即保存thread_... |
09434bc0f8f5434ba8656d36a9cdd9dd8a9a650c | 808a170bd49de916ab5a590323e484c9d24540e7 | hnkfwhw/MiniPs | /io/hdfs_manager.hpp | C++ | hpp | 1,763 | permissive | //
// Created by aiyongbiao on 2018/9/25.
//
#pragma once
#include <thread>
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "base/node.hpp"
#include "base/serialization.hpp"
#include "boost/utility/string_ref.hpp"
#include "io/coordinator.hpp"
#include "io/line_input_format.hpp"
namespace minips {
... |
e96f47b050ad132f1af58b86ef23f1e0428a258e | 2588b2a6d7c27007f920edd36e13df395423b5bc | niuxu18/logTracker-old | /second/download/httpd/gumtree/httpd_repos_function_1676_httpd-2.4.10.cpp | C++ | cpp | 4,166 | no_license | static void *merge_autoindex_configs(apr_pool_t *p, void *basev, void *addv)
{
autoindex_config_rec *new;
autoindex_config_rec *base = (autoindex_config_rec *) basev;
autoindex_config_rec *add = (autoindex_config_rec *) addv;
new = (autoindex_config_rec *) apr_pcalloc(p, sizeof(autoindex_config_rec));
... |
7dce7dd227088829078ebc0ed67f1ae308933ac7 | 4f779c5c58822b69a74bad360153e02997608743 | CodeSourceIn/cpp | /simpleforloop.cpp | C++ | cpp | 420 | no_license | #include <iostream>
using namespace std;
int main() {
cout << "Simple for loop- Increment" <<endl;
cout << "--------------------------" <<endl;
for (int i = 1; i <= 10; i++){
cout<< i <<",";
}
cout <<endl <<endl;
cout << "Simple for loop- Decrement" <<endl;
cout << "----------------... |
9a35782c0217270fc29961e96e3f5971ac8e1f36 | b683e293a3a7395fa69e4cb1d71013bf4446ef8f | garyng/RememberToBuy | /src/storage/CategoryStorage.cpp | C++ | cpp | 979 | no_license | #include "stdafx.h"
#include "CategoryStorage.h"
CategoryStorage::CategoryStorage(const std::shared_ptr<ILogger>& logger): JsonStorage<Category>(logger)
{
}
std::string CategoryStorage::Filename() const
{
return NAMEOF(Category)".json";
}
std::vector<Category> CategoryStorage::DefaultData() const
{
return std::ve... |
c0a466af00e4434c47d09696bed5c293b76ee30f | c47e530701e226e12075e27249a047177d53f402 | Qasemt/teltonikaRes | /FMI/FMI_v3-1_with_HOS_v2-1/FMI_v3-1_with_HOS_v2-1/Fleet-Management-Controller/src/AobrdDriverItem.cpp | C++ | cpp | 15,676 | no_license | /*********************************************************************
*
* MODULE NAME:
* AobrdDriverItem.cpp
*
* Copyright 2012 by Garmin Ltd. or its subsidiaries.
*---------------------------------------------------------------------
* $NoKeywords$
***********************************************************... |
3981426dc2a43c7c04fab164c8b00e98fd4d4572 | e6a46d04bdcedc65b72eb82298fc875313244b42 | Krotikov/nm-lab4 | /lobatto.cpp | C++ | cpp | 760 | no_license | #include "lobatto.h"
//TODO: fix calc because this algorithm has some problems
double Lobatto::calc(double eps, int* count) {
int n = 1;
double len = rbord - lbord;
double integVal = (func(lbord) + func(rbord)) * len / 3.0;
double iPrev = 0;
double iNew = 0;
double err = 0;
do {
double newLen = len... |
72bb8a5a57861415eb66edbb69f9fc048978463a | 3aeef13cee7aa301385f808653c6e08008e46ef1 | carljwmeisner/rc2016-machine-learning | /linearRegression/src/data.cpp | C++ | cpp | 3,337 | no_license |
#include <stdlib.h>
#include <fstream>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include "data.h"
typedef std::vector <double> record_t;
typedef std::vector <record_t> data_t;
std::istream& operator >> ( std::istream& ins, record_t& record)
{
record.clear();
std::string line;
... |
fa534bd89331908518e3541d39821e64e54098b5 | 5256599e5c8d412636a1fd19ab6e9660bc4c470e | TencentCloud/tencentcloud-sdk-cpp-intl-en | /teo/src/v20220106/model/DeleteOriginGroupResponse.cpp | C++ | cpp | 3,904 | permissive | /*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
... |
c4fab24f78534a14f1f335972703e1e051c012ad | 04a7e35a9bae9bca6f27234b40a6a7ad8cc7ac22 | mkmartinw/compute-runtime | /unit_tests/gen9/skl/test_preamble_skl.cpp | C++ | cpp | 4,818 | permissive | /*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/command_stream/thread_arbitration_policy.h"
#include "runtime/command_stream/preemption.h"
#include "runtime/gen9/reg_configs.h"
#include "runtime/helpers/preamble.h"
#include "unit_tests/preamble/preamble_fixture.h"... |
d9062ca29ddb4ebd4b2be09771955c17a637173f | d8ba31cfdace2cca600b4b8f03f42c4398771181 | gbrlas/AVSP | /CodeJamCrawler/dataset/12_18382_35.cpp | C++ | cpp | 1,707 | no_license | #include <cstdio>
#include <ctime>
#include <cstdlib>
#define N 1000
typedef long long int ll;
ll w, l, n;
int t;
ll r[N];
ll x[N], y[N];
bool intersect(int k){
for(int i = 0; i < n; i++){
int j = k;
if(i == k){
continue;
}
if((x[i] - x[j])*(x[i] - x[j]) + (y[i] - y... |
40396cc410a9bc6b1f5a36a06bf38676fe68e4ab | 91c76119b65e2cc3ea0d8316628f9e072aa0a720 | jarivandam/hu-ipass | /servo/servo.hpp | C++ | hpp | 822 | permissive | #include "hwlib.hpp"
#ifndef SERVO_HPP
#define SERVO_HPP
/// \file
/// \brief
/// this is a control class for servo motors that use PWM.
/// \details
/// This class controls servos that use pwm.
/// You can manipulate the pulse duration.
/// Every millisecond you must call the updateServo function, it
/// will send ... |
a7ab65d94b7f190525350678b38b587f2248a42b | 11e69f7d3112f774bb696899b3b5a2d6a698f025 | google/memcpy-gemm | /src/gemm_test_lib_internal_test.cc | C++ | cc | 16,009 | permissive | #include "src/gemm_test_lib_internal.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "src/gemm_test_lib.h"
#include "src/multi_gemm_lib.h"
namespace platforms_gpus::gemm_test::internal {
namespace {
#if CUDA_VERSION >= 10010 // CUDA 10.1 or greater
TEST(SelectGemmInterfaceTest, Int8TensorTuringSquareM... |
1e0acf34b2d6f07ff605f16687fa115538bb0c61 | 61b17ff539ce98d388b67046e6035be86b49f6d8 | cea56/chromium | /chrome/browser/themes/theme_service_win.cc | C++ | cc | 10,400 | permissive | // Copyright 2016 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/themes/theme_service_win.h"
#include "base/bind.h"
#include "base/win/windows_version.h"
#include "chrome/browser/themes/theme_p... |
e11bd770151ebf290fc678fd319c14f2f90cb9d5 | d9560bcd764843f2568b6a8bed52b338fafedc23 | ashutosh0gupta/llvm_bmc | /examples/litmus/c/run-scripts/tmp_5/Z6.3+dmb.st+dmb.sy+ctrlisb.c.cbmc.cpp | C++ | cpp | 40,415 | no_license | // Global variabls:
// 0:vars:3
// 3:atom_2_X0_1:1
// 4:atom_2_X2_0:1
// Local global variabls:
// 0:thr0:1
// 1:thr1:1
// 2:thr2:1
#define ADDRSIZE 5
#define LOCALADDRSIZE 3
#define NTHREAD 4
#define NCONTEXT 5
#define ASSUME(stmt) __CPROVER_assume(stmt)
#define ASSERT(stmt) __CPROVER_assert(stmt, "error")
#define m... |
bcce3b195c5a416ae3fdeac91816afc37a025f2b | 4762243d9c603084d7060ee31b8dc777c745cd2d | TravisWhitaker/CCL | /program.hpp | C++ | hpp | 519 | permissive |
/*
* File: program.hpp
* Author: iconmaster
*
* Created on January 21, 2016, 2:48 PM
*/
#ifndef PROGRAM_HPP
#define PROGRAM_HPP
#include <list>
#include <vector>
#include "operation.hpp"
#include "instruction.hpp"
#include "object.hpp"
namespace ccl {
using namespace std;
class ccl... |
ce361201bc3a28ae6fb7127ef44731ec45830f33 | 6f4235a5490ff2711f05101a3280ac2ba258e249 | sxw106106/cpp-learning | /const/const.cpp | C++ | cpp | 743 | no_license | #include <iostream>
using namespace std;
int main()
{
//const char *p;
//char const *p;
//char * const p;//error uninitalize
// char * const p='a';// invalid conversion from ‘char’ to ‘char*’ ;p read-only
char a='a'; char b='b';
const char * const p=&a;
// *p=&b;//p read-only, //assignment of read-only location ... |
421c16430da6e9527e93a0fdaa0e6e7753657534 | 8be2d02384f133fc7021d2e70969f441d5abb21c | haaami01/arrow | /r/src/array_to_vector.cpp | C++ | cpp | 41,805 | 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... |
e5b62d71a9b849b9f593382ee5fa31ccbf28da3f | 70aea6039d31b8d2cd8e66eef1636edb4549fc92 | dstrub18/NDKFramework | /Example_Circuits/DiodeClipper/VST/DiodeClipper/Source/PluginProcessor.cpp | C++ | cpp | 6,661 | no_license | /*
==============================================================================
This file was auto-generated!
It contains the basic framework code for a JUCE plugin processor.
==============================================================================
*/
#include "PluginProcessor.h"
#inc... |
493770380121835d7fa691d71ee7a4994e74c4d1 | 9a69ffa848dfb038f74076dc865c93742ecc0179 | RussellJerome/DeepRockGalacticSDK | /SDK/FSD_BuildPatchServices_parameters.hpp | C++ | hpp | 366 | no_license | #pragma once
// DeepRockGalactic SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "FSD_BuildPatchServices_classes.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
... |
be24ef534f092710a63c00941bc040b6e2e56008 | 3ac62500f28ab695f12ae906ee6e44d6aeb1c057 | TrabajoInformatica/Juego_Maleg_Trabajo_Informatica | /Maleg/src/Heroe.cpp | C++ | cpp | 4,135 | no_license | #include <iostream>
#include "Heroe.h"
using namespace std;
Heroe::Heroe() :
run("imagenes/spartanRUN.png", 4, 3),
jumpUP("imagenes/spartanJUMPup.png", 4, 2),
jumpDOWN("imagenes/spartanJUMPdown.png", 4, 3),
vida1("imagenes/VIDA1.png", 1, 1),
vida2("imagenes/VIDA2.png", 1, 1),
vida3("imagenes/VIDA3.png", 1, 1),
... |
0673147f83285bd1ea8984a531b854da20838b00 | 7a52986aa90879600de65a982e67d46eaee34eb1 | atique7465/Competetive_programming | /LeetCode/1470. Shuffle the Array.cpp | C++ | cpp | 273 | no_license | class Solution {
public:
vector<int> shuffle(vector<int>& nums, int n) {
vector<int>res;
int i = 0, j = n;
while(j < nums.size()){
res.push_back(nums[i++]);
res.push_back(nums[j++]);
}
return res;
}
}; |
7d1a4141fef951857ed8aefd592b6a17063c5858 | d3452ee4a878525eb7a4baeaf87deef7442f99f8 | gh-fork-dump/serenity | /Kernel/VM/SharedInodeVMObject.cpp | C++ | cpp | 2,325 | permissive | /*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, t... |
cbc3be394518f32c8e00fa15d7446575e2eb05e2 | 7fc341694e76ef73f893dfdc05d11e65efa96392 | nie-lijuan/enenen | /字符动画.cpp | C++ | cpp | 846 | no_license | #include <stdio.h>
#include <conio.h>
#include <time.h>
#include <windows.h>
#include <stdlib.h>
void gotoxy(int x, int y);
int main()
{
system("color f0");
long i;
char FileName[100], hi[4840];/*这里是字符数组,用来存储从文件打开的字符串*/
FILE *in;
//getch();
printf("3\n");
Sleep(1000);
printf("2\n");
Slee... |
7ff7d2e54968ff2a089889a2509b0ee858991bf9 | ff53b689aeee25da037d57797f9816029f8b514f | yanoshi/torch4microscopic | /torch4microscopic/mat_converter.cpp | C++ | cpp | 2,143 | permissive | #include "mat_converter.h"
using namespace cv;
using namespace std;
MatConverter::MatConverter(std::shared_ptr<std::vector<cv::Mat>> input, parameters::Values values)
{
this->input_obj = input;
this->param_values = values;
}
std::shared_ptr<std::vector<cv::Mat>> MatConverter::get_result()
{
std::shared_ptr<vector... |
1cd7d89c1d6f913f44e441c8b58ed2d981192f9c | d9caed41ddbaf753f023904ca940f479cf75c91d | shabalind/llvm-project | /polly/lib/Support/RegisterPasses.cpp | C++ | cpp | 27,745 | permissive | //===------ RegisterPasses.cpp - Add the Polly Passes to default passes --===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
5670404e0b254680ff9e09a2cca7319d77ea048e | df3bee89789498117bcc5f5f43d4832781983334 | ric2b/Vivaldi-browser | /chromium/extensions/renderer/bindings/exception_handler.cc | C++ | cc | 5,737 | permissive | // Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "extensions/renderer/bindings/exception_handler.h"
#include "base/check.h"
#include "base/strings/stringprintf.h"
#include "base/supports_user_data.h"
#include "exten... |
630bdea9bc61a625133b573874fe89915dfacd1d | d55e5a45ff561ad8b2ecb0cdb9ea82cf009b8bd4 | caishanli/ncnn | /src/layer/riscv/concat_riscv.cpp | C++ | cpp | 23,112 | permissive | // Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy ... |
10fb6fb548aced6b08d25298a3403308e6d9c04d | 54eb43423cd57513b1514050bf91bfbbcf9a2a6a | mpsitech/brly-BeamRelay | /brlyd/BrlydJobprc.cpp | C++ | cpp | 6,340 | permissive | /**
* \file BrlydJobprc.cpp
* job processor for Brly daemon (implementation)
* \copyright (C) 2016-2020 MPSI Technologies GmbH
* \author Alexander Wirthmueller (auto-generation)
* \date created: 11 Jan 2021
*/
// IP header --- ABOVE
#include "Brlyd.h"
#include "BrlydJobprc.h"
using namespace std;
using namesp... |
143dce2a40978d98a7f05ae7dc36aa31c55525ab | 8c3edd8c0936e8375ab9687433f9b3868426a4ce | NarenMadham/Problem-Solving-Using-Data-Structures-and-Algorithms | /ARRAYS/next_permutation.cpp | C++ | cpp | 754 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
vector<int> arr;
for(int i=0;i<n;i++){
int temp;
cin>>temp;
arr.push_back(temp);
}
int f = 0;
int i = n-1;
int j = n-1;
while(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.