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 |
|---|---|---|---|---|---|---|---|---|
21d3054386a027e4641ce0f5ed1eeaf55fd421fa | 9c1f86d2c195ceb74b55895f1d5b5e42f1ce85ea | VickeyMandal/cplusplus | /Arrays/ArraysSumOfTwoArrays.cpp | C++ | cpp | 805 | no_license | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(){
int a[1000] = {0},b[1000] ={0};
int n,m;
cin>>n;
for (int i = 0; i < n; i++)
{
cin>>a[i];
}
cin>>m;
for (int i = 0; i < m; i++)
{
cin>>b[i];
}
int o = max(n,m);
int ans[o];
... |
e55a3486ca2f400caea4435c97a7c44c78f87f7f | b331eea99f197c1f432ad910bad93a67d5481931 | geekonion/LIEF | /src/ELF/NoteDetails/NoteAbi.cpp | C++ | cpp | 2,792 | permissive | /* Copyright 2017 - 2023 R. Thomas
* Copyright 2017 - 2023 Quarkslab
*
* 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 req... |
e9ded14bf665fb38f3778e44ca14dc8d932b3e23 | bcac73f5b8efa9cffc5dfa38cdac2755078c6f3d | rayofhope-dev/xray-16 | /src/xrEngine/IInputReceiver.cpp | C++ | cpp | 1,824 | permissive | #include "stdafx.h"
#pragma hdrstop
#include "xr_input.h"
#include "IInputReceiver.h"
#include "SDL_syswm.h"
void IInputReceiver::IR_Capture(void)
{
VERIFY(pInput);
pInput->iCapture(this);
}
void IInputReceiver::IR_Release(void)
{
VERIFY(pInput);
pInput->iRelease(this);
}
void IInputReceiver::IR_Get... |
07475370ecdea13f1c6c261bfcf0ac75cebac7d9 | 697e3f77023bdc18ce34ea84ab805a91bd1dd562 | chenkaiidy/libdnn | /src/libdnn_conv.cpp | C++ | cpp | 71,861 | permissive | #include <algorithm>
#include <string>
#include <vector>
#include "common.hpp"
#include "device.hpp"
#include "libdnn.hpp"
#include "benchmark.hpp"
// #define LIBDNN_DEBUG 1
namespace greentea {
template<typename Dtype>
LibDNNConv<Dtype>::LibDNNConv(LibDNNConvConfig config) {
config_ = config;
LibDNN<Dtype>::de... |
853ac403d4b2f37615eaf112bc831100c684d198 | 2956fea0fae205a08567e8866ac4383a140434c8 | itomych/xcodetemplates | /Empty File Templates/C++ File.xctemplate/WithHeader/___FILEBASENAME___.hpp | C++ | hpp | 251 | no_license | //
// ___FILENAME___
// ___PROJECTNAME___
//
// Created on ___DATE___.
//___COPYRIGHT___
//
#ifndef ___FILEBASENAMEASIDENTIFIER____hpp
#define ___FILEBASENAMEASIDENTIFIER____hpp
#include <stdio.h>
#endif /* ___FILEBASENAMEASIDENTIFIER____hpp */
|
ed035da397096543ad191df7660bf6e80caf8b84 | 2693f9a9f4d4cd1f579bc0fab3385190bb334f88 | niuxu18/logTracker-old | /second/download/squid/gumtree/squid_old_hunk_1102.cpp | C++ | cpp | 4,205 | no_license | hdr_out->addEntry(e->clone());
}
}
break;
case HDR_HOST:
/** \par Host:
* Normally Squid rewrites the Host: header.
* However, there is one case when we don't: If the URL
* went through our redirector and the admin configured
... |
300c11ab2da7200208da627aed7bf126f11dee73 | 42b7f416a24f4353bcd0f7bcd29a234168d13351 | ssarmis/cshow | /src/fadecomponent.cpp | C++ | cpp | 1,394 | no_license | // cshow a simple slide show program.
//
// Copyright (C) 2018 Streanga Sarmis-Stefan<streangasarmis@gmail.com>
//
// This program is free software : you can redistribute it and / or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the L... |
5dc14adcf652a2bb3ab7748de62a3a054c9741da | dddb9aba794ef8dc5ce8218dd75f42c96b8ccdae | PeterAlfonsLoch/app | /appseed/core/core/core/core_match.cpp | C++ | cpp | 1,830 | no_license | //#include "framework.h"
namespace core
{
namespace match
{
bool _and::matches(const var & var) const
{
return m_pitem1->matches(var) && m_pitem2->matches(var);
}
string::string(const char * psz) :
m_str(psz)
{
}
bool string::matches(const var & v... |
cf17a4309a1cab905e21cb3699b6bc8357dad31a | a7aba2fa5410e50dd8ac36f9e62cb0898f6545c0 | desihub/specex | /src/specex_linalg.cc | C++ | cc | 3,029 | permissive | #include <specex_linalg.h>
#include <specex_message.h>
#include <specex_blas.h>
#include <specex_lapack.h>
#include <vector>
// contains all calls to C-wrappers (specex_*) calling C-interface BLAS and LAPACK functions
// returns the dot product of x and y
double specex::dot(const unbls::vector_double& x, const unbls... |
b20d774dc6859dba873636d819d9745a17fd06fd | 75256d4fb4abb056bfcf3559dd4858a848d5dcf8 | 0xF6/openvino | /ngraph/test/runtime/pass/fused_op_decomposition.cpp | C++ | cpp | 3,323 | permissive | //*****************************************************************************
// Copyright 2017-2020 Intel Corporation
//
// 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://w... |
6b9f9982955b3d97508d10e6543a03ae7419a65b | c32617309082b8b598889450608626875f85ea6a | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE191_Integer_Underflow/s02/CWE191_Integer_Underflow__int_fgets_sub_82_goodB2G.cpp | C++ | cpp | 1,222 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE191_Integer_Underflow__int_fgets_sub_82_goodB2G.cpp
Label Definition File: CWE191_Integer_Underflow__int.label.xml
Template File: sources-sinks-82_goodB2G.tmpl.cpp
*/
/*
* @description
* CWE: 191 Integer Underflow
* BadSource: fgets Read data from the console ... |
33edbb1166dd85fd4c6175b5b76f4965d5c76a49 | c17ab4fadcbddb3aea566ed650a573e8f4d00fb5 | Jackrekirby/AcCoRD2 | /AcCoRD2/src/mesoscopic_layer_neighbour_relationship.cpp | C++ | cpp | 1,126 | permissive | // The AcCoRD 2 Simulator (Actor - based Communication via Reaction - Diffusion)
// Copyright 2021 Jack Kirby. All rights reserved.
// For license details, read LICENSE.txt in the root AcCoRD2 directory
#include "pch.h"
#include "mesoscopic_layer_neighbour_relationship.h"
#include "mesoscopic_layer.h"
#include "mesos... |
d7c9995da522d8621652ebc6e46fab46e5d99707 | 2d45e140ad601e26b6cb52a02e20ec9a8fceeb95 | jdillenkofer/klong | /src/lexer/lexer.cpp | C++ | cpp | 40,189 | permissive | #include "lexer.h"
#include "common/compilation_error.h"
namespace klong {
std::multimap<char, Lexer::LexerCaseCallable> Lexer::cases = {
// plus
{'+', std::bind(&Lexer::plus, std::placeholders::_1, std::placeholders::_2)},
// arrow, minus
{'-', std::bind(&Lexer::arrow, st... |
086f8a0a77d193151d0d13aba82b3d777bd6124a | a1b1570dca5f5161728e99043b696799fcbbeb0a | fisho-park/fishochain | /plugins/state_history_plugin/include/eosio/state_history_plugin/state_history_serialization.hpp | C++ | hpp | 31,690 | permissive | #pragma once
#include <eosio/chain/account_object.hpp>
#include <eosio/chain/controller.hpp>
#include <eosio/chain/exceptions.hpp>
#include <eosio/chain/generated_transaction_object.hpp>
#include <eosio/chain/global_property_object.hpp>
#include <eosio/chain/permission_link_object.hpp>
#include <eosio/chain/permission... |
27475f4b5d944596ec298842d01006b72f1c676c | be39015ce92a5e153c16ab9d3ad679d713ac9da8 | SimonNitzsche/OpCrux-Server | /libs/RakNet/GridSectorizer.cpp | C++ | cpp | 6,212 | no_license | #include "RakAssert.h"
#include "GridSectorizer.h"
//#include <stdlib.h>
#include <math.h>
GridSectorizer::GridSectorizer()
{
grid=0;
}
GridSectorizer::~GridSectorizer()
{
if (grid)
delete [] grid;
}
void GridSectorizer::Init(const float _maxCellWidth, const float _maxCellHeight, const float minX, const float minY... |
6eccd4204fcbfc1b9f23a2329342acafe14519e3 | ba3c6a6c25eb8a2f78b957198636e7e7b6088c74 | bhaswatib/InterviewBit-AllQuestions | /Math (2) Verify Prime.cpp | C++ | cpp | 410 | no_license | /*
Verify Prime
Given a number N, verify if N is prime or not.
Return 1 if N is prime, else return 0.
Example :
Input : 7
Output : True
*/
Solution:
int Solution::isPrime(int A)
{
if(A==1) return 0;
else if(A==2 || A==3) return 1;
else if(A%2==0 || A%3==0) return 0;
else
{
for(int i=5;i*i<=A;i=i+6)
... |
dce0508f030d43a0a9b0c1d4e49d0d3633fb8668 | 2ea4181b733898f3f05da933d94aaf2975bd9ef1 | HaeJi-Woo/HelloVS | /HelloVS/ex3-5.cpp | C++ | cpp | 790 | no_license | #include <stdio.h>
typedef struct {
int row;
int col;
int value;
} term;
void smTranspose(term a[], term b[])
{
int m, n, v, i, j, p;
m = a[0].row;
n = a[0].col;
v = a[0].value;
b[0].row = n;
b[0].col = m;
b[0].value = v;
if (v > 0) {
p = 1;
for (i = 0; i < n; i++)
for (j = 1; j <= v; j++)
if (a... |
41d1673221dcbdc26059d84c4b88265433d0c87d | 92def0b4e23cd06d2db177a484d09c73ecdd6075 | heeran-xilinx/Vitis_Libraries | /vision/L1/examples/integralimg/xf_integral_image_accel.cpp | C++ | cpp | 837 | permissive | /*
* Copyright 2019 Xilinx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
fea05a3b5452aafee9bdd0fc128175824a6da16f | 49a8b4155e670ee326493c7b65bd70eb954ec918 | jcmartin91/lldb | /source/API/SBTypeNameSpecifier.cpp | C++ | cpp | 3,270 | permissive | //===-- SBTypeNameSpecifier.cpp ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------... |
e830e777d63dd1a57c8dcaab71db664a2e4ff244 | 005a04bff00e80ccc4b69f515c3cc8b77d3923ba | skyellen/robwork-mirror | /RobWork/example/simplegui/src/EventListener.hpp | C++ | hpp | 360 | permissive | #ifndef EVENTLISTENER_HPP_
#define EVENTLISTENER_HPP_
class EventListener {
public:
/* enum EventType{MENUITEM_EVENT,MENU_EVENT,SPECIAL_KEY_EVENT,KEY_EVENT};
*/
enum EventType{e_MENUITEM_EVENT,e_SPECIAL_KEY_EVENT,e_KEY_EVENT};
virtual ~EventListener(){};
virtual void event(EventType type, void *data) ... |
89c96ca78049026ad0fd75634b4f768870bbf8fa | 0a628d087b5a2f16e17aa27b46e0e955de9ee3c5 | sadrulhc/chromium | /components/sync/engine_impl/commit.cc | C++ | cc | 9,750 | permissive | // Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/sync/engine_impl/commit.h"
#include <utility>
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/n... |
4fe4407a94128aa3d6cef5dbfa4955c2e7a7f8d7 | 7ebe97e0606e55485eccad687b624c65132ccaec | cyyself/OILife | /Codeforces/1058A - In Search of an Easy Problem.cpp | C++ | cpp | 224 | no_license | #include <bits/stdc++.h>
int main() {
int n;
bool ans = false;
scanf("%d",&n);
for (int i=0;i<n;i++) {
int t;
scanf("%d",&t);
if (t) ans = true;
}
if (!ans) printf("EASY\n");
else printf("HARD\n");
return 0;
}
|
765ab22d7405de8bc87047fbfd985c86b2795dd6 | 636f6448ae659c4510ad97de197bd98cf3f51c4b | matus-chochlik/llvm-project | /llvm/lib/Transforms/Utils/LoopUnroll.cpp | C++ | cpp | 34,235 | permissive | //===-- UnrollLoop.cpp - Loop unrolling utilities -------------------------===//
//
// 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
//
//===---------------------------... |
6a5cecee27cce8a2d2b9d009d121ddd63903992d | e6cc6470f43cacff79ba9e2964bd4e92f6d7d3d4 | chaomengnan/aliyun-openapi-cpp-sdk | /mts/src/model/QueryMCTemplateListResult.cc | C++ | cc | 3,138 | permissive | /*
* Copyright 2009-2017 Alibaba Cloud 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... |
13d3357bad4b12bc277bb9c75ceac68b0c65e04a | 05c880bc5cd07cf10afceb810e610b20b853fcd7 | gamefortech123/splitgate-cheat | /splitgate/core/sdk/sdk/MRMesh_functions.cpp | C++ | cpp | 13,933 | no_license | #include "..\..\pch.h"
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------
//... |
71dcadb02ef9649e3cfd2f95892b0c5f62fcca24 | 74526e6e3a5697bc7265ba4a523ec55662badc9d | gopaljaiswal/Competition-Problems-Solution-CPP-Python | /GeeksForGeeks/StockBuyAndSell.cpp | C++ | cpp | 1,546 | no_license | #include <iostream>
using namespace std;
struct Interval
{
int buy;
int sell;
};
void getRes(int A[], int N)
{
Interval I[N / 2 + 1];
int count = 0;
int i = 0;
while (i < N - 1)
{
while ((i < N - 1) && (A[i + 1] <= A[i]))
{
i++;
}
if (i == N -... |
6066f6161ed1e49705f9b106f50e33f85e4416a4 | 7c69a196d7e8e62a1c4d6574823b5557c8deb38f | cody0755/chromium-src-chrome-browser | /sync_file_system/drive_file_sync_util.cc | C++ | cc | 2,949 | permissive | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/sync_file_system/drive_file_sync_util.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "chrome/browser/s... |
cd6261f80912b3a70b3270032c6dd3feab568383 | 9be128676156a26f65c3f6bfc092acbf66c875ec | james-storey/digitalClouds | /src/testApp.cpp | C++ | cpp | 2,188 | no_license | #include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
//ofSetFullscreen(true);
ofBackground(100, 127, 220);
ofSetLogLevel(OF_LOG_VERBOSE);
ofSetFrameRate(60);
ofSetOrientation(OF_ORIENTATION_DEFAULT, true);
ofSetupScreenPerspective(ofGetWindowWidth(), ofGetW... |
715ea777b47d0ab46accdaa25e4f88cf2f635b26 | da64551c30533e6dfb816cb7bae5dd7aee7337a3 | WhiZTiM/coliru | /Archive2/94/792db74377e313/main.cpp | C++ | cpp | 12,988 | no_license | #include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <tuple>
#include <vector>
#include <iomanip>
#include <boost/multi_index/mem_fun.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index_container.hpp>
using namespac... |
9c76409c8b6f6c56b9b1795b0e46114fa5ebe97b | a6bb5e36450d1238296c9534dea99157b13df379 | quanhengwen/njust-deliver-robot | /agv_ws/src/my_serial/src/ipc_serial.cpp | C++ | cpp | 2,519 | no_license |
#include "serial.h"
using namespace std;
int main(int argc, char **argv) {
ros::init(argc, argv, "serial_port");
//创建一个serial类
my_serial sp;
ros::Rate loop_rate(100);
while (ros::ok()) {
//获取缓冲区内的字节数
size_t n = sp.available();
if (n) {
uint8_t buffer[12];
//读出数据
n = sp.read... |
b8f1a3bbf6a111a667962b99b25baca48660bc88 | dded40140a5c4652ec3df821190711d1361d6352 | Sttide/ComputerGraphics | /work2_keyboardFunc/transfer.cpp | C++ | cpp | 1,929 | no_license | #include <gl/glut.h>
#include <math.h>
#define DEG_TO_RAD 0.017453 //角度转弧度
//设置渲染状态
GLfloat size=1.0;
void init()
{
glClearColor(0.0f,0.0f,0.0f,0.0f);
glColor3f(1.0,1.0,1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
}
GLfloat theta = 0.0;
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glBe... |
1827982ffde9c267da2ff815b9b515eb929e44b4 | bc258fc595c954e9342130a1e660dc88af329019 | tianxianbaby/chromium | /ui/compositor/dip_util.cc | C++ | cc | 4,421 | permissive | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/compositor/dip_util.h"
#include "base/command_line.h"
#include "cc/layers/layer.h"
#include "ui/compositor/compositor.h"
#include "ui/co... |
1ab8eb6605227d5443301adffbd35c58f016968f | 433faa13cfe23fbf28c702d18be3e5a6a46ccdea | unai-i/coworkers-sailfish | /src/socialextra/eventfilterinterface.cpp | C++ | cpp | 10,792 | no_license | /*
* Copyright (C) 2013 Lucien XU <sfietkonstantin@free.fr>
*
* You may use this file under the terms of the BSD license as follows:
*
* "Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of so... |
eb2384a37b4306b8523c65adf519562906f6e845 | 002fa89c26ff04811058ed316feaea5690e7c474 | b3c/MAF3 | /src/mafPluginZip/mafPluginRegistrator.cpp | C++ | cpp | 1,247 | permissive | /*
* mafPluginRegistrator.cpp
* mafPluginQt
*
* Created by Matteo Giacomoni on 03/07/12.
* Copyright 2012 SCS-B3C. All rights reserved.
*
* See Licence at: http://tiny.cc/QXJ4D
*
*/
#include "mafPluginRegistrator.h"
using namespace mafCore;
using namespace mafEventBus;
using namespace mafResources;
usi... |
64e9198e075e631fd371a8066065970814f05c90 | a14f8c7c08715ba3ea26c5244fede09c66020a96 | navi-cs467/cubeRunner | /HEADER/Space.hpp | C++ | hpp | 1,374 | no_license | /********************************************************************
** Program name: Space.hpp
** CS467 Capstone - 2D Runner - "Cube Runner"
** Team: NAVI
** Date: 4/25/2019
** Description: Header file for Space class. The Space class is
** one of three world types for the game. The colors
** and obstacles ar... |
583bdb30b5db96dadc9834d962030bbc74121c3e | 21feb122da1217c14e6cf0c322d5f27154cccf6b | yong-li/ClickHouse | /src/Databases/DatabaseFactory.cpp | C++ | cpp | 5,465 | permissive | #include <Databases/DatabaseAtomic.h>
#include <Databases/DatabaseDictionary.h>
#include <Databases/DatabaseFactory.h>
#include <Databases/DatabaseLazy.h>
#include <Databases/DatabaseMemory.h>
#include <Databases/DatabaseOrdinary.h>
#include <Parsers/ASTLiteral.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/fo... |
93191721407787327200d46fc36f8872e825702f | 735331c520c984aa58c273f43e791dfaa8911c2e | akb825/ModularShaderLanguage | /Compile/src/TargetSpirV.cpp | C++ | cpp | 1,911 | permissive | /*
* Copyright 2016-2022 Aaron Barany
*
* 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... |
5e930513934c37be656e0a30dbc57a1b8157252c | 2908b76fb62c7245115d02041b73c5a669534929 | Veda-Coin/Veda-Core | /src/qt/paymentserver.cpp | C++ | cpp | 28,094 | permissive | // Copyright (c) 2011-2015 The Bitcoin Core developers
// Copyright (c) 2014-2017 The Veda Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "paymentserver.h"
#include "bitcoinunits.h"
#include "guiutil.h... |
fc00020c0f9f62567dd942a4eb91b5d98e430bbf | bf4e0576b4a6b7846c92485976041c1a6684f45c | NikitaNikson/X-Ray_Renewal_Engine | /ogsr_engine/xrGame/zone_effector.cpp | C++ | cpp | 2,094 | permissive | #include "stdafx.h"
#include "zone_effector.h"
#include "level.h"
#include "clsid_game.h"
#include "..\xr_3da\xr_object.h"
#include "..\xr_3da\cameramanager.h"
#include "actor.h"
#include "actoreffector.h"
#include "postprocessanimator.h"
CZoneEffector::CZoneEffector()
{
radius = 1;
m_pp_effector = NULL;
m_pActo... |
49c6cd2533762fc70d38604f8c7182e6a99b9df8 | 827f047e7ab24777375f19d5219740140ea9ffff | rampa2510/dsa | /ArrayProblems/invertDigit.cpp | C++ | cpp | 347 | no_license | #include <iostream>
using namespace std;
int main() {
string s, t;
int c = 0, n;
cin >> s;
for (char z : s) {
t = s;
if (c != 0 || t[0] != '9') {
n = t[c] - '0';
if (n >= 5) {
n = 9 - n;
t[c] = n + '0';
if (t < s)
s = t;
}
}
c++;
}
cout <... |
9e5024642d0ecb0daa9e89185142bc7f31af2e65 | bf1e9e271ef930b9e1a9a8497b270a002268a5ba | aaafwd/Online-Judge | /Volume 003 (300-399)/373.cpp | C++ | cpp | 998 | no_license | /* @JUDGE_ID: 19899RK 373 C++ "By Anadan" */
// Romulan Spelling
// Accepted (0.270 seconds using as much as 388 kbytes)
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define SIZE 256
inline void swapc(char &a, char &b) { a ^= b; b ^= a; a ^= b; }
int main(){
int i;
char buf[SIZE];
memse... |
2689264fb1ee22cd167d41b2dd91a9b977d8c874 | b5ab8c690763055d660d5712855c24dcdef259fe | doomsday861/Allofit | /REMONE.cpp | C++ | cpp | 1,109 | no_license | /**
* REMONE
**/
#include<bits/stdc++.h>
#define ll long long
#define testcase ll t;cin>>t;while(t--)
#define pb push_back
#define fi first
#define se second
#define vll vector<ll>
#define for0(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define run ios_base::sync_with_s... |
805968f1a2ce7ddcc79cabf59246bc48148d3696 | 14d070ebb47cb828ea069bb76d0c51fdbc53223f | Gello-o/BST | /main.cpp | C++ | cpp | 8,339 | no_license | #include <iostream>
#include "bstree.h"
#include <cassert> // assert
/**
Funtore per il confronto tra numeri interi.
Ritorna TRUE se il primo numero è minore del secondo
@brief Funtore per il confronto tra numeri interi.
*/
struct compare_int {
bool operator()(int a, int b) const {
return a<b;
}
};
/**
... |
4d23f2e146c14fe5dc62b62dc19b3df4077b3c83 | 53bd6af147ebafc117ff2ec7e4ccefdf71888fef | Poet-LiBai/pytorch | /test/cpp/lazy/test_cache.cpp | C++ | cpp | 2,783 | permissive | #include <gtest/gtest.h>
#include <c10/util/Exception.h>
#include <torch/csrc/lazy/core/cache.h>
#include <torch/csrc/lazy/core/hash.h>
#include <torch/csrc/lazy/core/ir.h>
#include <torch/csrc/lazy/core/shape.h>
#include <torch/csrc/lazy/ts_backend/ts_node.h>
namespace torch {
namespace lazy {
class CacheNode : pub... |
fe9d6c999c60eec43fbad1d5f9c9121f70ae1648 | 90ca185f7ae0136d861bdff4463f64ca06c3460b | zhenglab/OOP | /week6/stringEg1.cpp | C++ | cpp | 1,217 | no_license | #include <iostream>
#include <string>
using namespace std;
/*
template <class charT> struct char_traits;
template <class T> class allocator; //<memory>头文件下 allocator:分配器
template < class charT, //定义字符串中字符的类型
class traits = char_traits<charT>, // basic_string::traits_type
... |
96d3d44e1497299ee8594636137ce8d330a95a9e | 0fb55bd6c293825d53bd80e3afa5049a2c36d1fc | OHopiak/parallel_computation | /cuda_floyd/main.cpp | C++ | cpp | 3,453 | permissive | //
// Created by orest on 26/10/18.
//
#include <iostream>
#include <string>
#include <memory>
#include <ctime>
#include <algorithm>
#include <chrono>
#include <unistd.h>
#include <fstream>
#include "src/floyd.h"
#include "src/utils/timer.h"
using namespace std;
using namespace std::chrono;
unique_ptr<graphFloydTopol... |
0cc4629b8b0c7c7cfe7777b69debd3fcf70cad0c | 5312ee159da844226ea6bf866ac364f15f954da7 | r00tk1ts/cpp-primer-5th | /ch15/ex15_28.cpp | C++ | cpp | 319 | no_license | #include "ex15_26.h"
#include <iostream>
#include <vector>
int main()
{
std::vector<Quote> v;
for(auto i=0;i!=10;++i)
v.push_back(Bulk_quote("sss", i*10.1, 10, 0.3));
double total = 0;
for(const auto &b : v)
{
total += b.net_price(20);
}
std::cout << total << std::endl;
return 0;
}
|
79af334ef6ba896bb01e53b84eb648c4fafb5080 | 27f0b2befe2aaecc03684bf50285804cbee16adb | EthanLuong/Contagion-School-Project | /main.cpp | C++ | cpp | 17,931 | no_license | /* Prog2Contagion.cpp
Program #2: Play the game of Contagion against another person
This is a variation of Ataxx, a version of which can
be played online at: http://www.classikgames.com/ataxx.html
Class: CS 141
Date: 1/27/2019
Author: Ethan Luong
Grading Rubric:
55% P... |
63faeda75bb28c441ef638a323d662f5ed0be579 | 33413ebc28b81344b794ad4b37612d6fe129a635 | profoundsoul/chromium | /chrome/browser/task_manager/sampling/task_manager_impl.cc | C++ | cc | 24,808 | permissive | // Copyright 2015 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/task_manager/sampling/task_manager_impl.h"
#include <algorithm>
#include <string>
#include <unordered_map>
#include <unordered_s... |
bacd80b99b80767548098ad463007c69cf1c055d | 08105a56a380f9867885866bbf083ae07fd8d3aa | wxmvolker/OPS | /apps/c/poisson/MPI_OpenMP/poisson_omp_kernels.cpp | C++ | cpp | 646 | no_license | //
// auto-generated by ops.py//
//header
#define OPS_2D
#define OPS_ACC_MD_MACROS
#include "ops_lib_cpp.h"
#ifdef OPS_MPI
#include "ops_mpi_core.h"
#endif
#include "user_types.h"
//set max number of OMP threads for reductions
#ifndef MAX_REDUCT_THREADS
#define MAX_REDUCT_THREADS 64
#endif
//global constants
extern d... |
4a8a20d6c26c6f7e4077bd5210ef9154518e4822 | e4b717e0869b9fc8f3a6493121ed577ed62b5c45 | MA-JIE/ROS | /evaluation2/src/ecn_turtle_control/src/ecn_turtle_robot_publisher.cpp | C++ | cpp | 2,393 | no_license | /**
\file ecn_turtle_path_publisher.cpp
\brief Publishes an rviz arrow marker to represent the robot.
\author(s) G. Garcia
\date 19 May 2016
*/
//Cpp
#include <math.h>
//ROS
#include "ros/ros.h"
//ROS msgs
#include <tf/transform_broadcaster.h>
#include <visualization_msgs/Marker.h>
#... |
a13dc39bc8000fa23722b6ac61b466fa93ad06f2 | 2a910a992a377eec5271bdcc15d587b4f9630e50 | devarshar/Data-Structures-Class-FA17 | /problem of the day/potd-q17/main.cpp | C++ | cpp | 1,017 | no_license | #include <iostream>
#include "potd.h"
using namespace std;
void printList(Node *head) {
if (head == NULL) {
cout << "Empty list" << endl << endl;
return;
}
Node *temp = head;
int count = 0;
while(temp != NULL) {
cout << "Node " << count << ": " << temp ->data_ << endl;
count+... |
e57e51a8f965bd7d46a6edb7e5a64c3c078f1b6e | 7de6990c4daf5fb72bad9d55f515ec7eb086daaa | ListratenkoIgor/OSiSP2 | /lab1/OSiSP-1/Figure.cpp | C++ | cpp | 1,465 | no_license |
#include "Figure.h"
AuthorRect::AuthorRect(int height, int width) {
this->height = height;
this->width = width;
brush = (HBRUSH)CreateSolidBrush(RGB(255, 0, 0));
}
void AuthorRect::Draw(HDC hdc, int x, int y) {
RECT r; //объявляем экзмепляр структуры RECT - координаты прямоугольника.
r.left = x; //левый верхни... |
cabe852a99cddaccb3025a5bd9213b3b81a95c65 | 6dbb8aaf4d189c0f03c37d4fdc8c52d3e6e31001 | rocdat/OPS | /apps/c/CloverLeaf_3D_HDF5/OpenCL/update_halo_kernel2_zvel_plus_2_bot_opencl_kernel.cpp | C++ | cpp | 10,659 | no_license | //
// auto-generated by ops.py
//
#ifdef OCL_FMA_SWITCH_ON
#define OCL_FMA 1
#else
#define OCL_FMA 0
#endif
static bool isbuilt_update_halo_kernel2_zvel_plus_2_bot = false;
void buildOpenCLKernels_update_halo_kernel2_zvel_plus_2_bot(int xdim0,
int ydim0,
... |
ff14d6696ea1b8382a6771e406a642d725f924c6 | 175d7efecc575e7de6b98148ab33f8ea21327434 | sritabh/ballistica | /src/ballistica/platform/platform.cc | C++ | cc | 42,988 | permissive | // Released under the MIT License. See LICENSE for details.
#include "ballistica/platform/platform.h"
#if !BA_OSTYPE_WINDOWS
#include <dirent.h>
#endif
#include <fcntl.h>
// Trying to avoid platform-specific headers here except for
// a few mostly-cross-platform bits where its worth the mess.
#if !BA_OSTYPE_WINDOWS
... |
9a286511fc2ca6ae12e6029af79e6e9bae0b881f | f17a2e234f85295b7f60d3107fea1622c18adc94 | Ra1nWarden/Online-Judges | /UVa/10194.cpp | C++ | cpp | 3,536 | no_license | #include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <map>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cctype>
using namespace std;
struct Team {
string name;
int totalpoints, gamesplayed, wins, ties, losses, goaldiff, goalscore, goalagainst;
Team(string na... |
7f7280deb00392bc5dbda906bb41e1c25d65e843 | ff6ced0054f4ce690ef522f15a8a62b347b08764 | getpro/bleeding_edge | /dart/runtime/vm/os_thread_win.cc | C++ | cc | 13,114 | permissive | // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h" // NOLINT
#if defined(TARGET_OS_WINDOWS)
#include "vm/os_thread.h"
#in... |
8a82e33ba4ee9fc887de2dd398a7d34a1f778628 | 51e95c46caad228733709580d8df29a113e1df58 | YuriCat/test | /cpp/bitset.cpp | C++ | cpp | 338 | no_license | #include <iostream>
#include <bitset>
using namespace std;
template <size_t N>
void out() {
cerr << "sizeof(bitset<" << N << ">)" << " = " << sizeof(bitset<N>) << endl;
}
int main() {
out<1>();
out<2>();
out<4>();
out<8>();
out<16>();
out<32>();
out<64>();
out<96>();
out<128>(... |
e1514cad3a2b390f29a150a55f36a23fd9d8b619 | c63606e65d9d5a1ccff40066af4e493f5689a1c5 | brhmyldrm01/Algorithm | /cumle hece sayısı bulma.cpp | C++ | cpp | 477 | no_license | #include<iostream>
using namespace std;
int main(){
char cumle[100];
int i=-1;
cout<<"Girdiginiz cumlenin hece sayisi bulunacak"<<endl;
do{
i++;
cin>>cumle[i];
}while(cumle[i]!='.');
int hecesayisi=0;
for(int a=0;a<i;a++){
if(cumle[a]=='E'||cumle[a]=='a'||cumle[a]=='u'||cumle[a]=='i'||cumle[a]=='... |
25b91442a2a0d73039d22d8c37580b2007e3dab3 | f15a1e029949e01402efa449eae8f0782e796006 | roboception/rc_genicam_api | /rc_genicam_api/system.cc | C++ | cc | 13,698 | permissive | /*
* This file is part of the rc_genicam_api package.
*
* Copyright (c) 2017 Roboception GmbH
* All rights reserved
*
* Author: Heiko Hirschmueller
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redis... |
fc2ef44c321ebe0f575d03fd8579dbecc0706fb3 | 766dd5a2e0301be47c593c21459cde2e08d10add | nkirov/nkirov.github.com | /2006/NETB151/sources/ch9/bestval1_.cpp | C++ | cpp | 1,349 | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
vector<string> names;
vector<double> prices;
vector<int> scores;
double best_price = 1;
int best_score = 0;
int best_index = -1;
// bool more = true;
// while (more)
while (!cin.eof())
{
s... |
c41a40f76ff987c603a492aec0a2e5e9a8ce0e9c | eea37bea37a8b6d80d8c64c13089e867f447959c | fedulvtubudul/warm-woody-knocker | /warm-woody-knocker/src/Rhythm/Pattern.cpp | C++ | cpp | 8,876 | permissive | #include "Pattern.h"
Pattern makeClavePattern() {
int length = 16;
Pattern pattern = {
title: String("Clave"),
meter: 8,
length: length,
lowChannelValues: new SoundLevel[length],
highChannelValues: new SoundLevel[length]
};
int i = 0;
pattern.lowChannelValues[i++] = SoundLevel::low;
pattern.lowChann... |
614167dc19a1067ac166184c1e625f5eb8725167 | 2956978593cf3e4e081145b0a766830697729260 | yc299792/C-server-study-route | /算法类/designtemplate/dutychain/main.cpp | C++ | cpp | 328 | no_license | #include<iostream>
#include"request.h"
#include"employee.h"
#include"Manager.h"
int main()
{
Request req("zhangsan",20,8000);
Request req1("zhanglong",20,88888);
Manager manager("lisi", "manager", nullptr);
Employee e("wangwu", "employee", &manager);
e.handleReuest(req);
e.handleReuest(req1);
system("pause... |
59774b92eb87ff51c072fd410ca0d71a40f61ba7 | cee7c91a0aaa69968b3d5088ce3d9837ea810bce | vydramain/Re.TESRougeFalkreath | /include/systems/scenes_systems/game_loop_systems/controls/GLControlScoreSave.hpp | C++ | hpp | 1,117 | no_license | //
// Created by vydra on 8/19/20.
//
#pragma once
#include "systems/scenes_systems/game_loop_systems/controls/GLControlExit.h"
#include "systems/scenes_systems/game_loop_systems/controls/IGLControl.h"
#include "systems/scenes_systems/statistics_systems/IStatisticsSystem.hpp"
#include "systems/scenes_systems/statisti... |
61682fefd1399e2352e926133198d855bf7dedcb | 7c6d9b2725d65a94f29c05577827de71b9a1922c | chkob/forked-blaze | /blazetest/src/mathtest/dmatsmatmult/HDaDCa.cpp | C++ | cpp | 4,455 | permissive | //=================================================================================================
/*!
// \file src/mathtest/dmatsmatmult/HDaDCa.cpp
// \brief Source file for the HDaDCa dense matrix/sparse matrix multiplication math test
//
// Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved
//
// Thi... |
758da42da947d59bb0dfdce8879c22e7e532ab3c | 0269aff7abfdf16ae504751b2b1ce0d0cd071b14 | hoodja/CplusPlusGameOfLife | /src/DeadRulesTest.cc | C++ | cc | 407 | no_license | #include <limits.h>
#include "rules.h"
#include "Deadrules.h"
#include "gtest/gtest.h"
TEST(Rules, ApplyToDeadCells){
Rules* rules = new DeadRules;
EXPECT_EQ(false, rules->Apply(0));
EXPECT_EQ(false, rules->Apply(1));
EXPECT_EQ(false, rules->Apply(2));
EXPECT_EQ(true, rules->Apply(3));
EXPECT_EQ(false, rules->Ap... |
4cc8f3a912808e2b22e5172a29f8b08698c7e207 | c647e8ea70645a80b19f33ff6b8e675872f8f6b3 | AndyJMR/ITK | /Modules/Core/Common/test/itkByteSwapTest.cxx | C++ | cxx | 5,815 | permissive | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
19ef0c6208dd6708055b11a37b4eeabcdaef0a22 | ce78cd47be9678a873a8054bc09792efc1be910f | cmpt-376-a4/TheAbyss | /src/InputHandling/inputhandling.cpp | C++ | cpp | 2,382 | no_license | #define GLEW_STATIC
#include <GL/glew.h>
#include <map>
// GLFW
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <math.h>
#include "../Character/include/mainchar.h"
#include "../MainEngine/include/world.h"
#include "../MainEngine/include/threads.h"
// timing
static float deltaTime = 0.0f; // time between curren... |
53c03a69c7d0fb5efab4ead6e957d5a73b489620 | d4a19b8c8e524d4a8036835845583748d731b43c | arielsaadon/cpp_Ex2_MessageBoard | /Board.cpp | C++ | cpp | 2,697 | no_license | #include "Board.hpp"
#include <iostream>
#include <string>
using namespace std;
using namespace ariel;
void Board::post(unsigned int row, unsigned int col, Direction direction, const string &massage){
unsigned int tCol = col;
unsigned int tRow = row;
if (tCol < minCol){
minCol = tCol;... |
5af3570ceda0feb218f22102aff34c95adf091ce | 843a0cab577b519c16edff1340380347bb16a283 | Hanyi-Wang-DarkStardust/Database-Implementation | /A3/Main/DatabaseTable/source/Sorting.cc | C++ | cc | 7,343 | permissive |
#ifndef SORT_C
#define SORT_C
#include <MyDB_PageListIteratorAlt.h>
#include "MyDB_PageReaderWriter.h"
#include "MyDB_TableRecIterator.h"
#include "MyDB_TableRecIteratorAlt.h"
#include "MyDB_TableReaderWriter.h"
#include "Sorting.h"
using namespace std;
//class comp{
// MyDB_RecordPtr lhs;
// MyDB_RecordPtr... |
f291adf0594ebde744c22abcb04805392600b05d | 2122fd45aab5e0ff0f5a676ba6402f8af56b1da7 | RahmadaniBayuAji/ChakraCore | /lib/Runtime/Types/DynamicObject.cpp | C++ | cpp | 33,902 | permissive | //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//---------------------------------------------------------... |
aabf5e89deb24c52d9df12a2d6db96b134acf96f | 9f4cfe663656d084e549f2f0108d223b4a6a917c | vlad77177/cproject | /Practic6_task2/Practic6_task2/practic6_task2.cpp | C++ | cpp | 1,205 | no_license | /* The longest sequence=837799, 524 steps*/
#include <stdio.h>
#define MIN 2
#define MAX 1000000
int Kollatz(long long int n,int step,bool print){
if(print==true)
printf("%lli step=%d\n",n,step);
if(step==0){
if(n<MIN || n>MAX)
return 0;
}
if(n==1){
return step;
... |
c4eb72a408f8c737fc2932ca76cd2069b1d50c84 | 90ec43721edc78d459df7874c3de076eafe7b404 | agrawalnishant/tensorflow | /tensorflow/core/kernels/matrix_solve_op.cc | C++ | cc | 5,357 | permissive | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
b58531f74a0757486dc347ce8d5d0188322e72e7 | fc4abce85220095fba8d48e6acf1ad5f3781086d | lijiansong/hscpp | /test/integration-tests/simple-printer-test/src/Main.cpp | C++ | cpp | 1,256 | permissive | #include <chrono>
#include <thread>
#include "hscpp/Platform.h"
#include "hscpp/Util.h"
#include "hscpp/Hotswapper.h"
#include "integration-test-log/Log.h"
#include "simple-printer-test/Printer.h"
#include "simple-printer-test/GlobalData.h"
hscpp::fs::path SANDBOX_PATH = hscpp::util::GetHscppTestPath() / "sandbox";
h... |
3d1501bbf6d47da9885ad522a40eedc295a8ae7d | c407de127c1c2f8cbe841462aa17a01f31342012 | antimodular/Nature-Of-Code-Open-Frameworks-Port | /Nature Of Code OF/NOC6_4__Flow_field_following/src/ofApp.cpp | C++ | cpp | 1,606 | no_license | #include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofBackground(0);
ofSetBackgroundAuto(true);
flowField = FlowField(20);
vehicles = VehicleFleet(50);
}
//--------------------------------------------------------------
void ofApp::update(){
... |
e512ec620c73fb52321aa10396553147a967c8ec | c3f021f3d790c370341763e570b70f76abceff25 | isakson98/Artificial_Market | /Stock_Exchange_Server/Stock_Exchange.cpp | C++ | cpp | 8,901 | no_license | #include "Stock_Exchange.h"
using namespace std;
// * issue. I need to continue listening to new users even after initialization
/*
purpose:
initiliaze the server for the stock exchange,
creating socket, bind socket to Ip / port
*/
Stock_Exchange::Stock_Exchange()
{
cout << "Exchange is running" << endl;
... |
d0187dfe9e8e185879aea66dfe211c141974324f | 50c2e32ef6e971f3586adc07b86865710a2a6aca | fredericLechevalier/Shared_projects | /arcade_console/includes/Games/Snake.hpp | C++ | hpp | 3,198 | no_license | /*
** EPITECH PROJECT, 2022
** B-OOP-400-MLH-4-1-arcade-theotime.schmeltz
** File description:
** Snake.hpp
*/
#pragma once
#include "IGameModule.hpp"
namespace Arcade {
namespace Game {
class Snake : public IGameModule
{
public:
/**
* @brief Init Snake
... |
9dca2699a8d00b0a6db5c0bccd0a5d5eeecd6a55 | 7b8e204152189987b1cfed8acf155630448bead3 | Slimakanzer/gpu-studies | /radeon/radeon-asm-pooling/RadeonPooling/common/dispatch.hpp | C++ | hpp | 5,452 | no_license | ////////////////////////////////////////////////////////////////////////////////
//
// The University of Illinois/NCSA
// Open Source License (NCSA)
//
// Copyright (c) 2016, Advanced Micro Devices, Inc. All rights reserved.
//
// Developed by:
//
// AMD Research and AMD HSA Software Development
//
// ... |
34b9ed17a06e06fcf738e01601da37844eddd07b | 881a1e69722864b9fde73727505905fb17402499 | orcchg/CppCourse | /Lesson_13/advanced/aes_crypting.cpp | C++ | cpp | 4,161 | no_license | #include <openssl/conf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <iostream>
#include <string>
#include <string.h>
void handleErrors(void)
{
ERR_print_errors_fp(stderr);
abort();
}
int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key,
unsigned char *iv, unsigned char *c... |
50d84cdc3cfd73c9b0677f8b95406b3d6f5bd1c3 | e64ea651974ad793b133d0b83e31fac4b0cc3154 | IMXEWANG/chromium | /components/pdf/renderer/pdf_accessibility_tree.cc | C++ | cc | 65,563 | 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 "components/pdf/renderer/pdf_accessibility_tree.h"
#include <algorithm>
#include <utility>
#include "base/i18n/break_iterator.h"
#include "base... |
93b8d7e75b59428a529a07e6983f4e2f2b114588 | 9b60904ac67f37e06fc8f4432d783b0f77697ff7 | ellnor01/OpenCL-CTS | /test_conformance/math_brute_force/unary_u_double.cpp | C++ | cpp | 10,513 | permissive | //
// Copyright (c) 2017 The Khronos Group Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... |
d7152feda7c56532c5d139fe445e8ebf06a6e407 | eee512622ac43a10a05dfcee2ca8a16d22d35317 | singhalpranav22/Interview-Concepts | /DP/GridDP/uniquePathinGrid.cpp | C++ | cpp | 1,059 | no_license | // Given a grid of size m * n, lets assume you are starting at (1,1) and your goal is to reach (m,n). At any instance, if you are on (x,y), you can either go to (x, y + 1) or (x + 1, y).
// Now consider if some obstacles are added to the grids. How many unique paths would there be?
// An obstacle and empty space is ma... |
d10f1f9a5c69ae7d33f44e8d0f5f961a65b05ce4 | 1f0e3f0b9973116aa786a5c580e5c4d2f069d9db | alexandraback/datacollection | /solutions_5658571765186560_0/C++/ZhNV/D.cpp | C++ | cpp | 1,291 | no_license | #include <iostream>
#include <string>
#include <cstdio>
#include <ctime>
#include <cassert>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstdlib>
#include <cstring>
using namespace std;
#ifdef WIN... |
8576ca252a1b10f8381b087fe3ab648262c56883 | 6fd3eee7d4e06f726dbe36cde6d283c2c78eec8f | sounak07/DS-algo-pointer-Programs | /Recursion/allindices.cpp | C++ | cpp | 509 | no_license |
int allIndexes(int input[], int size, int x, int output[]) {
/* Don't write main().
Don't read input, it is passed as function argument.
Save all the indexes in the output array passed and return the size of output array.
Taking input and printing output is handled automatically.
*/
if(size == 0)... |
ebe8f62491546f48ce3826ff4e801ab96c136b70 | 5fef599ad036054e67de597cd8b7e6a29ee0f454 | 84489556/hxg_app115_rn_upgrade | /Libraries/FormulaDB/fe/YD__Fml.hpp | C++ | hpp | 3,339 | no_license | //
// YD__BPYC.hpp
// DzhChart
//
// Created by apple on 16/6/13.
// Copyright © 2016年 dzh. All rights reserved.
//
#ifndef YD__FML_hpp
#define YD__FML_hpp
#include <stdio.h>
#include "YDFormulaBase.hpp"
//变盘预测
class BPYC : public Formula
{
public:
virtual const FormulaResults& run() override;
};
//仓位策略
cl... |
dab202c6c8c376f2fb71418a3b10f220de47c97a | e8179864857f3b68690a568476ab24d3c94188d3 | artallo/problem-solving-in-cpp | /queue-patients-linked-list/example-ptr.cpp | C++ | cpp | 5,254 | permissive | #include <iostream>
// #include <fstream>
#include <cstring>
#include <windows.h>
using namespace std;
struct student {
char familya[80], name[80], otch[80], group[80];
int year;
};
struct queue {
student x;
queue* next;
};
void print(const student& x);
queue* push(queue* end, studen... |
6ce7496cb04ee278cfd1cb4278c4af435891094d | ee56446e2eadaa1c163f5314bb0dccff67e5bd71 | biswajitcsecu/ngraph | /src/ngraph/frontend/onnx_import/op/matmul_integer.hpp | C++ | hpp | 1,475 | permissive | //*****************************************************************************
// Copyright 2017-2019 Intel Corporation
//
// 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://w... |
f1c0fd4209cd208ca00cace83c794e7cbfea73e3 | d06f249ae3b997c8de78209d429ec4da490ec36f | rutvikgondaliya/30-Days-of-Code | /Hackerrank day16.cpp | C++ | cpp | 274 | no_license | #include <string>
#include <iostream>
#include <exception>
using namespace std;
int main(){
string S;
cin >> S;
int I;
try {
I = stoi(S);
cout << I << endl;
} catch (...) {
cout << "Bad String" << endl;
}
return 0;
} |
5cbd08dc73d3688534a09a14cb2d010580aa0fde | 8bfadf498e4135e2ab3916d410263e39700afcec | dachii-azm/atc | /abc/abc048/B.cpp | C++ | cpp | 274 | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int a, b, x;
cin>>a>>b>>x;
long long int cnt = 0;
long long int upper = b / x;
long long int lower = a / x;
if(a%x == 0) cout<<upper - lower + 1<<endl;
else cout<<upper - lower<<endl;
}
|
3c1a9850ecbc68e1f3196f0d5b195e535012f549 | 516c0473b08664e302c5acaf87e11adb82c6be93 | panmari/cpptracer | /src/scenes/meshTest.cpp | C++ | cpp | 2,026 | no_license | #include "scenes/meshTest.h"
#include "integrators/debugIntegrator.h"
#include "integrators/whittedIntegrator.h"
#include "intersectables/instance.h"
#include "intersectables/mesh.h"
#include "intersectables/plane.h"
#include "intersectables/sphere.h"
#include "materials/blinn.h"
#include "materials/diffuse.h"
#include... |
6cda26c290dccda721145679570c923da90fad96 | b391fc3476eddde84c9d541a73d0246c66c5b9f0 | Kawser-nerd/CLCDSA | /Source Codes/CodeJamData/17/13/16.cpp | C++ | cpp | 1,807 | no_license | #include <sstream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cassert>
#include <ctime>
#include <map>
#include <math.h>
#include <cstdio>
#include <set>
#include <deque>
#include <memory.h>
#include <queue>
#pragma comm... |
cdf30d455c54e38e91932cfd8c19e04e5ddfeb6e | 2ddc5f4103b547a6f79a372b17b1f29293ebd06f | Corinaxsy/CS246-fall-2016 | /tutorials/tut6/rvalue.cc | C++ | cc | 456 | no_license | #include <iostream>
using namespace std;
void check(const int& value){
cout << "check called with lvalue " << value << endl;
}
void check(const int&& value){
cout << "check called with rvalue " << value << endl;
}
int main(){
int x = 5;
// int& lref = 7;
int& lref2 = x;
int&& rref = 10;
// int&& rref... |
8a9a5f5bd3b7e6bd6cc562074807700fe1bac95d | 44561f05047652446dcd109bb1ac781566d08cf5 | meniossin/src | /third_party/blink/renderer/modules/mediacapturefromelement/html_canvas_element_capture.cc | C++ | cc | 3,360 | permissive | // Copyright 2015 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 "third_party/blink/renderer/modules/mediacapturefromelement/html_canvas_element_capture.h"
#include <memory>
#include "third_party/blink/public/... |
33e0c150227823379b8c58308c14431960387f02 | b7b5455d6491016bfe1f251324b7f7ff0cdb645e | EmulationChannel/dynarmic | /externals/vixl/vixl/benchmarks/aarch64/bench-dataop.cc | C++ | cc | 2,696 | permissive | // Copyright 2019, VIXL authors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions ... |
2b863b7ddaeac898366bf71bd48ed0baaafa88f9 | 00a2af4150603925d01570ee75235bd4d29b2529 | rayhan-ferdous/ProvMod-Legacy | /fully injected sources/Hype_CRHM.cpp | C++ | cpp | 129,731 | no_license | #include <vcl.h>
#pragma hdrstop
#include "Hype_CRHM.h"
#include "NewModules.h"
#include "DefCRHMGlobal.h"
#include <math.h>
#include <stdlib.h>
#pragma package(smart_init)
using namespace std;
using namespace CRHM;
const long i_in = 0;
const long i_on = 1;
const long i_sp = 2;
const long i_pp = 3;
const long i_oc ... |
bc138bb901cbdaabf93a629b388d576ab9db765b | 080eddb9199351ef5540f6feb81ea3e62b914278 | markkun/galaxy | /galaxy/src/galaxy/graphics/TextureAtlas.hpp | C++ | hpp | 4,004 | permissive | ///
/// TextureAtlas.hpp
/// galaxy
///
/// Refer to LICENSE.txt for more details.
///
#ifndef GALAXY_GRAPHICS_TEXTUREATLAS_HPP_
#define GALAXY_GRAPHICS_TEXTUREATLAS_HPP_
#include <filesystem>
#include <optional>
#include <robin_hood.h>
#include "galaxy/algorithm/RectPack.hpp"
#include "galaxy/graphics/texture/Rend... |
0adaa5b0503daeaa65de3130f9ace1ac013b5752 | 821f86f9ebd414a5412e751994b468d3c8b42b51 | KDE/akonadi | /src/core/jobs/searchresultjob.cpp | C++ | cpp | 2,610 | permissive | /*
SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "job_p.h"
#include "searchresultjob_p.h"
#include "private/protocol_p.h"
#include "protocolhelper_p.h"
namespace Akonadi
{
class SearchResultJobPrivate : public Akonadi::JobPrivate
{
pub... |
277216b7882ee63b9aa675064942c4f0faa30861 | 0a61d79e0def1a5e088467aec79d826a9bf7c4ae | avan-dam/CPP | /Module02/notes/e.g.00/Sample.class.cpp | C++ | cpp | 1,721 | no_license | /* ************************************************************************** */
/* */
/* :::::::: */
/* Sample.class.cpp :+: :+: ... |
d49f3435f9c584aacabc98cefcce7bc2441c4a75 | eec99750df8b02f633080771040cd03746d04c1d | mohit-agr/computervision-practice | /src/includes/StreamReader.hpp | C++ | hpp | 402 | no_license | #ifndef STREAM_READER_H_
#define STREAM_READER_H_
#include <memory>
#include <vector>
#include <opencv2/core.hpp>
enum Cam {
Cam0, Cam1
};
class StreamReader {
public:
void readImage(Cam cam);
void playImageStream();
std::shared_ptr<std::vector<cv::Mat>> getImage();
StreamReader(Cam cam);
privat... |
ae8047e305b654a1a24172c3b1145fe5f48b64d6 | 42ef5242dfcd1a15fa8e88cf62340fbc048420ed | bemkap/hj | /object.cc | C++ | cc | 2,929 | no_license | #include<algorithm>
#include"common.hh"
#include"env.hh"
#include"dict.hh"
#include"object.hh"
template<typename T>void parse1(lua_State*L,map<T,action>&m,const char*s){
lua_pushnil(L);
while(lua_next(L,-2)!=0){
int a=getaction(L);
T k=(T)getnumeric(L,s);
m.insert(pair<T,action>(k,action(a,L)));
lu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.