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 |
|---|---|---|---|---|---|---|---|---|
db463135d0584b201f522505100b5a20f506f12a | f069a41a5242f9cbbc34cfd2c812550d9bcf4e1e | Pikachuxxxx/VerletCloth | /vendor/glm/test/ext/ext_scalar_reciprocal.cpp | C++ | cpp | 3,692 | permissive | #include <glm/ext/scalar_reciprocal.hpp>
#include <glm/ext/scalar_relational.hpp>
#include <glm/ext/scalar_constants.hpp>
static int test_sec()
{
int Error = 0;
Error += glm::equal(glm::sec(0.0), 1.0, 0.01) ? 0 : 1;
Error += glm::equal(glm::sec(glm::pi<double>() * 2.0), 1.0, 0.01) ? 0 : 1;
Error += glm... |
9f6ab8d2ad088a9e802543117cee34addb7386c6 | d186d44b609942e1f51ddcc792ab4dac7e43a7b2 | mansisaksson/SecondPersonShooter | /SecondPersonShooter/Source/SecondPersonShooter/EnemyCharacter.cpp | C++ | cpp | 5,198 | no_license | #include "SecondPersonShooter.h"
#include "EnemyCharacter.h"
#include "Perception/PawnSensingComponent.h"
#include "DefaultGameMode.h"
#include "PlayerCharacter.h"
#include "AIController.h"
AEnemyCharacter::AEnemyCharacter()
{
GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);
GetCapsuleComponent()->OnComponentHit... |
11c98ced37247d6a8b8474892278177214549eb6 | 34a40303c670f6d4baf2f57ddf12745522760dac | uel-dataexchange/Opencascade_uel | /inc/IGESSolid_SolidAssembly.hxx | C++ | hxx | 3,772 | no_license | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _IGESSolid_SolidAssembly_HeaderFile
#... |
90bd08a7edb517949bb0f8fd078f1301a77dc416 | d34051810cb934f5572f7f42b002c67ae269886e | bioinroboticsuottawa/pumpkin_ws | /src/pumpkin_interface/src/arduino.cpp | C++ | cpp | 2,034 | no_license | #include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <ros/ros.h>
#include "rosserial_server/serial_session.h"
/*!
* Arduino node
* ============
*
* This node is a modification of the code of the *rosserial_server*.
* It will look for any active serial port of an determined st... |
a88f82a447c3fa0b59632c17d5397d6c59f6fa1e | 46884fb6ebb13044ab92b85c0f59bb30281260bf | KqSMea8/sstd_library | /sstd_boost/sstd/libs/regex/example/snippets/icu_example.cpp | C++ | cpp | 5,565 | permissive | /*
*
* Copyright (c) 2004
* John Maddock
*
* 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)
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
*... |
850b615c74507f2a973f9782805cfad11e587cb9 | da66eb73dc48882e1429349c9b438cc0ddd189b4 | qinduanyinghua/oj | /Leetcode_solution/78. Subsets.cpp | C++ | cpp | 2,525 | no_license | /*
Given a set of distinct integers, nums, return all possible subsets (the power set).
Note: The solution set must not contain duplicate subsets.
For example,
If nums = [1,2,3], a solution is:
[
[3],
[1],
[2],
[1,2,3],
[1,3],
[2,3],
[1,2],
[]
]
*/
#include <iostream>
#include <vector>
#include <al... |
7cae892ecf6428e2c25419bd190335eec85653fe | 32574f9a811c789ff6d8e40b165a1a7ccc0895f5 | fenlan/Mycode | /LinkList3.cpp | C++ | cpp | 3,386 | no_license | /*程序为解决约瑟夫环问题
*缺陷:ListDelete_L(LinkList &L) 函数删除的是 L结点的后一结点,而不是L结点
* 导致67--91行代码太复杂。
*/
#include <stdio.h>
#include <stdlib.h>
typedef int ElemType;
typedef struct Node
{
ElemType number;
ElemType password;
Node *next;
}Node, *LinkList;
LinkList CreateList_L(int Element_quantity);
/*创建循环链表
*Element_n... |
c937e38d1bfb064f25192b2a60a99de0b2094c7f | 08b4fc1bff0be99f9008d97ed5040cb40ec3613c | KDE/veritas | /internal/overlaytoggle.cpp | C++ | cpp | 8,049 | no_license | /* KDevelop xUnit plugin
*
* Copyright 2008 Manuel Breugelmans <mbr.nxi@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 2
* of the License, or (at your option)... |
28e8d93a12649df165df97270c1e5abb6b3f54fd | 44a2fda5f159b6d00c890b8c02f9369cf42be078 | lostinspacebar/kabuki | /engine/include/input/keyboard_state.hpp | C++ | hpp | 628 | no_license | /**
* KABUKI GAME ENGINE
* ----------------------------------------------------------------------------
* @file keyboard.hpp
* @brief Global keyboard state
*/
#ifndef KABUKI_INPUT_KEYBOARD_STATE_H
#define KABUKI_INPUT_KEYBOARD_STATE_H
#include "input_codes.hpp"
#include <SDL.h>
namespace kabuki::input
{
... |
9e78334b28885462b1c15e9685fbea9dd7177732 | ce53aff33487a80a92097f684b143293144cb938 | pablopeza/MK6_Minisumo_Edition | /Mk6_Sumo_edition/src/main.cpp | C++ | cpp | 5,657 | permissive | // Made by Pablopeza for the Oshwdem2018 minisumo competition
#include <Arduino.h>
// Motor driver library by SparkFun
#include <SparkFun_TB6612.h>
// Sharp sensor library https://github.com/guillaume-rico/SharpIR
// Remember to reduce the number of measures for the median filter default = 25
#include <SharpIR.h>
//... |
567b273e7f0217158bd9605ad66dda0292efdefb | e75d3ef53c9a436cd90e1aa04ea566a708adbc68 | sees2012/chromium-src-chrome-browser | /signin/about_signin_internals.cc | C++ | cc | 8,121 | 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/signin/about_signin_internals.h"
#include "base/debug/trace_event.h"
#include "base/hash.h"
#include "base/i18n/time_formatt... |
2ea4c8cdc2ad8638f111ad32d1de0373662f011b | 9866ee48be2d4f7df8a9ba6aa1c1b0c1fb1f4af2 | digint/openmptl-reg-arm-cortex | /arm/cortex/Spansion/MB9BF10xR/include/arch/reg/mfs7.hpp | C++ | hpp | 24,249 | no_license | /*
* OpenMPTL - C++ Microprocessor Template Library
*
* This program is a derivative representation of a CMSIS System View
* Description (SVD) file, and is subject to the corresponding license
* (see "License.txt" in the parent directory).
*
* This program is distributed in the hope that it will be useful,
* bu... |
2e883b304440af514116f0a3f02c1f65b5c27d74 | 9dc986ef1783a3f0a5117a0c0264863776011dda | arrow-lang/arrow-legacy | /vendor/mach7/typeswitch/2013-02-18/metatools.hpp | C++ | hpp | 10,915 | permissive | ///
/// \file metatools.hpp
///
/// This file defines several utility functions used in XTL
///
/// \author Yuriy Solodkyy <yuriy.solodkyy@gmail.com>
///
/// This file is a part of Mach7 library (http://parasol.tamu.edu/mach7/).
/// Copyright (C) 2011-2013 Texas A&M University.
/// All rights reserved.
///
... |
3d9927f53700d46907ca700b1371b1a418c3d8ba | fe4151b1df13efb24e11e48706942d6ced23224e | knightzf/review | /leetcode/editDistance/mySol2.cpp | C++ | cpp | 736 | no_license | #include "header.h"
class Solution {
public:
int minDistance(string word1, string word2) {
int m = word1.size(), n = word2.size();
vector<vector<int>> dp(m + 1, vector<int>(n + 1, INT_MAX));
for(int i = 0; i < m + 1; ++i) dp[i][0] = i;
for(int i = 0; i < n + 1; ++i) dp[0][i]... |
87305c6dde9d9dfcd22fdba95e316dd7da4d85df | 364f0366314cc6098a594104f2056f4a859bf68d | leer89/SourceControlTest | /SourceControlTest/SourceControlTest.cpp | C++ | cpp | 543 | no_license | // SourceControlTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
string returnName(string x1, string x2);
int main()
{
string x1, x2, newName;
cout << "Randy Lee, Source Control Test" << endl;
cou... |
16900fa73a128ed62e822599e8cf35d935fba1f6 | 609ca405ec61f86d9eb6e27f6a3e7d67c70b8365 | wnsdudSoftkim/Introduction_to_computer_lab | /수강생/201804460김명우/lab1/Exmaple_3_c.cpp | C++ | cpp | 205 | no_license | #include <stdio.h>
int main() {
float amount = 0;
printf("Enter an amount : ");
scanf_s("%f", &amount);
int taxadd = amount + (amount * 0.05);
printf("With tax added : %d", taxadd);
} |
51bce52f83f1c3c042b77716d5cc70d40b8f0ec9 | b2976c46438bbcad1c6f6dc5c66ec70f79288f0f | locmpham/codingtests | /cpp/arrayMisc/findFirstLastPosition.cpp | C++ | cpp | 1,699 | permissive | /*
Given an array of integers nums sorted in ascending order, find the starting and ending position of
a given target value.
If target is not found in the array, return [-1, -1].
You must write an algorithm with O(log n) runtime complexity.
Example 1:
Input: nums = [5,7,7,8,8,10], target = 8
... |
d304b6eb2e9d162108be685f279d0f7f14f82c53 | 827555b2469e6fd0b28073adfd4e1eaf50c529ba | Ayesha049/all_contest_codes | /ALL CODES/L2 T2 practice/decodeprtc.cpp | C++ | cpp | 318 | no_license | #include<iostream>
#include<string.h>
using namespace std;
int main()
{
char s[10];
cin>>s;
int l=strlen(s);
int a,b,x,sum;
x=1;
sum=0;
for(int i=l-1;i>=0;i--)
{
a= (int)(s[i]-64);
b=x*a;
x=x*26;
sum=sum+b;
}
cout<<sum;
}
|
f0cdc4a5fcd639860172d1eaeeb7570c67a30433 | 76900b27e4e02012208511b9663493d4553d1b78 | andersju/miun-dt018g | /anje0901_projekt/menu.cpp | C++ | cpp | 1,398 | no_license | /**
* @file menu.cpp
* @author Anders Jensen-Urstad (anje0901) <anders@unix.se>
* @date 2018-01-09
* @version 1.0
* @brief Funktioner för menyvisning och menyinput
*/
#include "menu.h"
#include "constants.h"
#include "utils.h"
#include <iostream>
#include <vector>
/*
* Visar menyn och tar input
*
* ... |
9c67a4a7004d81a373dda8ed9e21dad892c31547 | df93b449a70b18cc04d6ee5040f685d757b18dee | strawhatboy/TasteTheSpear | /proj.win32/GameHudLayer.cpp | C++ | cpp | 1,953 | no_license | #include "GameHudLayer.h"
bool GameHudLayer::init()
{
INIT_START
CC_BREAK_IF(!CCLayer::init());
initSpellHud();
initHeroHud();
initEnemyHud();
initItemsSpellHud();
initScoreHud();
INIT_TRUE
INIT_END
}
GameHudLayer::GameHudLayer(void)
{
INIT_POINTER(m_HeroHud);
INIT_POINTER(m_EnemyHud);
INIT_POINTER(m_S... |
0001c54ed7e4d7a87ef9eead0b893a64bdae74e8 | 78f0eb2d6db7037bad6fbb8dcaa415f6301ce411 | TudorVersoiu/OOP-lab6-X | /MyVector/my_vector.hpp | C++ | hpp | 5,866 | no_license | #pragma once
#include <vector>
#include <cstdlib>
#include <exception>
#include <algorithm>
// Temporary implementation, may go nuts in 'special' cases
// Eg: threads :D
// Linked list implementation?!?
namespace my {
// -------------------------------------------------------------------
// Data type for vec... |
b3e690fd38f01cde5f48b1707c1f01f9c3e48b2d | fcea757f78f89df38d1f523418763cfdf594801c | Martins3/Ftp | /client/ftpClient_autogen/EWIEGA46WW/moc_mainwindow.cpp | C++ | cpp | 4,135 | no_license | /****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.14.1)
**
** WARNING! All changes made in this file will be lost!
*********************************************************... |
a5a5edac08767b1a3dfb3e56230656cb3f518df5 | 7585e4079cb24a54edd4d2872bd3350175ad67a5 | xtremi/arduino-bus-and-thermometer | /TFT_receive_data_mega_17122019/Graph.cpp | C++ | cpp | 643 | no_license | #include "Graph.h"
Graph::Graph(Axes* _axes){
axes = _axes;
prevPoint = axes->origin();
}
void Graph::resetGraph()
{
axes->drawAll();
prevPoint.x = axes->getOriginX() + (int)((0.0 - axes->minX()) * axes->xStep());
}
Pos Graph::getScreenCoords(const VecF& p)
{
Pos screenCoord;
screenCoord.x = axes->g... |
158b559f5d622953e178e408894730c215623dbc | eb28c7a9bf48a1ffdcba85d33e8e17742aff1052 | tensorflow/tensorflow | /tensorflow/compiler/xla/stream_executor/tpu/tpu_topology.cc | C++ | cc | 5,694 | permissive | /* Copyright 2020 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... |
a65b449a46b6e2a0a818c18a309ff73468710485 | db1da74f1a58ad8ff8f4f08e518394f24cb3ce0b | Ivancic91/RSoft | /LammpsIO/DumpIO/NextElem.cpp | C++ | cpp | 1,540 | no_license | #include <iostream>
#include <string>
#include "DumpIO.hpp"
/*
* Finds the next element in a space separated list starting from
* position start.
*
* User Inputs:
* const std::string& line A space separated list in string form
* int start An integer denoting where to start search
* ... |
3904ca8818772b92717ebdd20abfdcdc203c17c7 | 28b93a578c379d954308509de4eff1b9aaec10e7 | 0xbadcoffe/FPGA-OS | /app/memcached/hls/sources/globals.cpp | C++ | cpp | 4,778 | permissive | #include "globals.h"
#if 0
accessFilter::accessFilter(){
this->wrPtr = 0;
this->rdPtr = 0;
this->level = 0;
#pragma HLS array_partition variable=filterEntries complete
}
bool accessFilter::push(accessWord newElement) {
if (this->level < accFilterEntries) { // if the queue is not full
this->filterEntries[this->w... |
abb118ccc4f5f39ea929bb3585c679ca38e1f893 | 27ecf1f89ab54c1c17d82558982f3046a5dd966f | SREERAGI18/chromium | /base/task/single_thread_task_executor_unittest.cc | C++ | cc | 79,450 | permissive | // Copyright 2013 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 "base/task/single_thread_task_executor.h"
#include <stddef.h>
#include <stdint.h>
#include <string>
#include <vector>
#include "base/bind.h"
#... |
55cf685cfdb79299f4c193d4f910e4d37d8a0b18 | 2d88e7ee6efaf9e09c22ae22f36785b59bd09aa0 | rocheston/rosecoin | /src/compat/glibcxx_sanity.cpp | C++ | cpp | 1,754 | permissive | // Copyright (c) 2009-2017 The Bitcoin Core developers
// Copyright (c) 2020 The RoseCoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <list>
#include <locale>
#include <stdexcept>
namespace
{
// tri... |
7c12e0327dc25547a235bb11d4718850292b112c | 1677b67b55535b794979ced8a02cf6852d02da5a | Xinkai/pdfium | /core/fpdftext/cpdf_linkextract.cpp | C++ | cpp | 5,184 | permissive | // Copyright 2016 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "core/fpdftext/include/cpdf_linkextract.h"
#include <vector>
#inclu... |
8b5e181e753371c2ee959b5f25a141a6b435c062 | 77ac36701059495359697248217c07f609dcda0d | suraj1611/Competitive_Programming | /CP-Codes/Codes/Codeforces/449-div2/bb.cpp | C++ | cpp | 1,790 | no_license | #include<bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<n; i++)
#define rep1(j,m) for(int j=1;j<m;j++)
#define mx INT_MAX
#define mn INT_MIN
#define md 1000000007
#define pb push_back
#define mp make_pair
#define pf printf
#define sc scanf
#define maxsiz... |
e112e54d4d6ce8bb9fba4a0c579bd83d8636dac7 | 1ff2bfac98488d0e438071ac3399bc43fb957fe5 | laubens/PC-game | /Musicapp/Classes/LibraryScene.cpp | C++ | cpp | 758 | no_license | #include "LibraryScene.h"
#include "cocostudio/CocoStudio.h"
#include "ui/CocosGUI.h"
USING_NS_CC;
using namespace cocostudio::timeline;
Scene* LibraryScene::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = Library... |
fe72b1498e09036ed965363009d052d969c26844 | 486df4e7bbd40c3637141d2ccaa307f8ec7f1dd4 | Sam-MSU/Albany | /src/evaluators/QCAD_ResponseFieldValue_Def.hpp | C++ | hpp | 21,790 | permissive | //*****************************************************************//
// Albany 2.0: Copyright 2012 Sandia Corporation //
// This Software is released under the BSD license detailed //
// in the file "license.txt" in the top-level Albany directory //
//**************************************... |
f918c8364780e24b2871dd3833de664a6e2f9211 | 34c6177d586cd1dddffe6f753c97155a84f87f39 | Swoco/swococoin | /src/qt/askpassphrasedialog.cpp | C++ | cpp | 10,261 | permissive | #include "askpassphrasedialog.h"
#include "ui_askpassphrasedialog.h"
#include "guiconstants.h"
#include "walletmodel.h"
#include <QMessageBox>
#include <QPushButton>
#include <QKeyEvent>
extern bool fWalletUnlockStakingOnly;
AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
QDialog(parent),... |
6451841ae55ef20a92eb89521e42b6d2d6b916ef | 9f7b85a4c3664af8d5ea2fdfde47405c899d6bc8 | italiangrid/storm-frontend | /src/frontend/srmv2_GetRequestTokens.cpp | C++ | cpp | 7,051 | permissive | /* Copyright (c) Istituto Nazionale di Fisica Nucleare (INFN). 2006-2010.
*
* 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 ... |
2eff3edefcd03a6a5d100a35d385d3d1e153940a | 72c15a6cd98c7724f29a44a4eb2c80c6a357d784 | Denticle/docker-base | /php/php-sky/grpc/third_party/protobuf/src/google/protobuf/descriptor_database.cc | C++ | cc | 37,557 | permissive | // Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
... |
4dce1b83f21f94553a9e3170d38263d62f162432 | 88b9bf870d5926315151c30f6f5ab99f9e7abacf | Hixie/sdk | /runtime/lib/weak_property.cc | C++ | cc | 1,450 | 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 "vm/bootstrap_natives.h"
#include "vm/exceptions.h"
#include "vm/native_entry.h"
#include "vm... |
7335c5720b6862be308a44da38b13d7e2aaab7f3 | 9c8aae1f27c6050d2461e90863ddc5952a68b0ed | Agapanthus/grammar | /grammar/src/dictionary.hpp | C++ | hpp | 4,448 | permissive | #pragma once
#include "adjective.hpp"
#include "adverb.hpp"
#include "noun.hpp"
#include "pronoun.hpp"
#include "verb.hpp"
/*
struct Diathesis {
Person active, processualPassive,
statalPassive; // TODO: , causative, applicative;
};*/
class Dictionary {
private:
map<string, vector<Word>> dict;
pub... |
cdf1ab8ebccd44f8c4c3c07726b674f718d4fe8b | 6ef9e1edd3a4a6686c60cf0d97f02530b4c93ce7 | xiaotaohe/LeetCode_oj | /求路径总数.cpp | C++ | cpp | 343 | no_license | #include<iostream>
using namespace std;
int get_path(int n,int m)
{
if(n>1 && m>1)
return get_path(n-1,m)+get_path(n,m-1);
else if((n == 1&&m>=1)||(m == 1&&n>=1))
return n+m;
else
return 0;
}
int main()
{
int row = 0,col = 0;
while(cin>>row>>col)
{
cout<<get_path(... |
063cb14390a6a47e9c052b464219db64d93913f9 | 2bc36bb879fb9569adff8eac98c1b96bb2ad36c9 | aureooms-ulb-2010-2015/2011-2012-infof202-projects | /2/vehicle.hpp | C++ | hpp | 3,102 | no_license | #include "motor.hpp"
#define max_electric_motors 2
class Vehicle{
private:
string name;
protected:
virtual void setName(string name);
public:
Vehicle();
virtual void run(unsigned int miles) = 0;
virtual string toString() = 0;
virtual float getConsumption() = 0;
... |
1d1a08e6a26d9c826fcec782c08b3d7d33603c00 | 41bccd3a4c158fd69b0db9249a8ac158b9becf0d | iDestro/PAT | /SolutionsOfProblemSet/A1107.cpp | C++ | cpp | 1,631 | no_license | /*
* @Descripttion:
* @version:
* @Author: iDestro
* @Date: 2019-07-25 10:12:42
* @LastEditors: iDestro
* @LastEditTime: 2019-07-25 12:32:53
*/
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int *father;
bool *flag;
int ans[1001] = {0};
int Find(int x) {
while (x != fath... |
48eeb4a2f25c968a8197b4b04c1a2d4b664e8518 | 631fab9b7f165fc781fb9014bd5146a60856353a | WolfgangBai/LogDevice | /logdevice/common/protocol/LOGS_CONFIG_API_Message.cpp | C++ | cpp | 5,886 | permissive | /**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "logdevice/common/protocol/LOGS_CONFIG_API_Message.h"
#include "logdevice/common/GetLogInfoRequest... |
0bdd4a4b5f3948f3d94446046eddf31c9e025d48 | cc62fea6992b08273bc418cb01ef0eebdfc77db8 | lautaroba/Competitiva | /strings/Z_function.cpp | C++ | cpp | 305 | no_license | vector<int> z_function(string s) {
int n = (int) s.length();
vector<int> z(n);
for (int i = 1, l = 0, r = 0; i < n; ++i) {
if (i <= r)
z[i] = min (r - i + 1, z[i - l]);
while (i + z[i] < n && s[z[i]] == s[i + z[i]])
++z[i];
if (i + z[i] - 1 > r)
l = i, r = i + z[i] - 1;
}
return z;
}
|
d9fffcbc1fd6e3a635af4bf2afec0a411a0f6d0b | 04338c05a0c432c6192b42e9a1bd5385362e7b91 | ajax-crypto/libqss | /test/test.cpp | C++ | cpp | 3,171 | permissive | #include <QCoreApplication>
#include "include/qssdocument.h"
#define RESULTV(A, B, V) LOG(A << " should be: " << #V << " | Test pass status: " << (B == V));
#define RESULTSTR(A, B, V) LOG(A << " should be: " << V << " | Test pass status: " << (B == V));
void TestQSSParts()
{
LOG("\n\nBasic QSS Parsing...");
... |
4d1c6fccba4a88763fe56574feb3720306b09a63 | 51cb0071ee4acfaafe8c5e0f60aefd944b41e533 | eguilg/coding-interview-guide | /03.二叉树问题/08.找到二叉树中符合搜索树条件的最大拓扑结构/bstTopoSize.cpp | C++ | cpp | 3,917 | no_license | # include <bits/stdc++.h>
# include <limits>
using namespace std;
struct Node
{
/* data */
int val;
Node* left;
Node* right;
Node(int x): val(x), left(NULL), right(NULL){}
};
/**************************************************************
* 方法一 O(n^2) ... |
5de3afc6babdbca02afaf7d9347151455e8bf9cb | 6390262083105a64b9fb6b3260311ffbeff3378e | 15831944/Practice | /AttendanceUserSetupDlg.cpp | C++ | cpp | 21,685 | no_license | // AttendanceUserSetupDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ContactsRc.h"
#include "AttendanceUserSetupDlg.h"
#include "MultiSelectDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
using namespace NXDATALIST2Lib;
enum EUserComboColumns
{
... |
13d5a1de0611eed7bb81583c66cba5a1457dd39b | be8b8f0f1be969fb8a854f9acd2c50431a9cac4a | codecameo/ProblemSolved | /Contest/YEAR 2013/code chef contest/April contest/Maximum Weight Difference/Untitled1.cpp | C++ | cpp | 521 | no_license | #include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
long long int sum,sum1,sum2,ar[110],ans;
int n,k,t,i;
scanf("%d",&t);
while(t--)
{
scanf("%d %d",&n,&k);
for(i=0,sum=0;i<n;i++)
{
scanf("%lld",&ar[i]),sum+=ar[i];
}
sort(ar,ar+n);
for(i=0,su... |
b3df105e98802e977f2a4d50272bc23c896ce500 | f87c57b25076d41675e869e03b793e28798a9f0c | b69liu/OpenGL | /A2/oldA2.cpp | C++ | cpp | 17,089 | no_license | #include "A2.hpp"
#include "cs488-framework/GlErrorCheck.hpp"
#include <iostream>
using namespace std;
#include <imgui/imgui.h>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/io.hpp>
using namespace glm;
vector<float> p_buffer; //store the eight points
mat4 Mats;
vec3 car... |
80825cb206ce9a2b5fb4bb00106657986077ae6e | e8eff72d418f2877419c5bcc7a6f64f499fe6bcb | AntiSC2/TidyEngine | /libTidyEngine/model.hpp | C++ | hpp | 1,671 | permissive | /*
* TidyEngine
* Copyright (c) 2018 Jakob Sinclair <sinclair.jakob@mailbox.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
... |
d1106a73b3a6705b2e155c33217d4d58c8b320cb | 8eaf59140a27426b5c85300a4184b2b38aacc504 | karunmatharu/Android-4.4-Pay-by-Data | /external/chromium_org/chrome/common/spellcheck_common.cc | C++ | cc | 5,601 | 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/common/spellcheck_common.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "third_party/icu/source/common/unic... |
39013177f98d8332cc70355354f179111768cd21 | 7fdfd6cdc394c1804098d38200eccf6324bbfce5 | jiachengii/chromium | /third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc | C++ | cc | 38,726 | 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 "build/build_config.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer.h"
#include "third_party/blink/ren... |
315c5a877d5706c1b267b008f15ce96178df59ce | 9a6d2d37ecc340fd3253a679cb7fd1476d6cffc0 | ChristopherRabotin/GMAT | /src/gui/include/gmatwxdefs.hpp | C++ | hpp | 3,174 | permissive | //$Id$
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
// Copyright (c) 2002 - 2020 United States Government as represented by the
// Administrator of the National Aeronautics and Space Administration.
// All Other Rights Reserved.
//
// Licens... |
3986635d8ec14be586e770ae9756d5e718f198a6 | b826bb9b2d1ef3a5222ba7e64684f7c8c8571f0d | niuxu18/logTracker-old | /second/download/git/gumtree/git_repos_function_3344_git-2.13.6.cpp | C++ | cpp | 284 | no_license | static struct submodule_hash_entry *alloc_submodule_hash_entry(
const char *submodule, struct ref_store *refs)
{
struct submodule_hash_entry *entry;
FLEX_ALLOC_STR(entry, submodule, submodule);
hashmap_entry_init(entry, strhash(submodule));
entry->refs = refs;
return entry;
} |
7361ab41ec23457c97782f9932f16f1f8e9ba277 | 4f8e796fe8051db8f5fa95dc7ba7d965f7f4e04a | Edisonfb/Mc_Donalds_Thread | /TrabModelagem/GreadorRandom/GreadorRandom/Origem.cpp | C++ | cpp | 493 | no_license | #include <iostream>
#include "Random.h"
using namespace std;
void main()
{
Random R;
int i = 0;
for (i; i < 100; i++)
cout << R.random() << endl;
i = 0;
system("pause");
system("cls");
for (i; i < 100; i++)
cout << R.uniforme(8, 20) << endl;
i = 0;
system("pause");
system("cls");
for (i; i < 100; i++... |
47946cf987f19cc22be0b49b2241702615ed7b04 | 2ae164633b9b912680a477c4809d45c204fc8938 | btc-free-mining/bitcoin | /src/i2p.cpp | C++ | cpp | 12,119 | permissive | // Copyright (c) 2020-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <chainparams.h>
#include <compat.h>
#include <compat/endian.h>
#include <crypto/sha256.h>
#include <fs.h>
#include <... |
acb9061e41d79e3b72ff3e9f31bcb3484cac8c94 | 6ebc01e723ea3bfa3d70ca610363ff7aab183bd2 | jingshenglyu/Robotics-TU-Berlin | /Assignment 2/Fri_2K_ex2/forwardkinematics.cpp | C++ | cpp | 11,679 | no_license | /*
Please fill in the function stubs provided in this file
For achieving full points on this exercise, explain the implemented equations well using comments. Especially:
- which parameters were used for computation?
- were equations simplified? What was the original equation?
- when introducing addi... |
e97b91cb4794139072a332d276c4514976196fa1 | 2569aaf395a8d69d52c7ea8f44f892d114f82310 | anilkunwar/cantera | /src/numerics/CVodesIntegrator.cpp | C++ | cpp | 12,930 | no_license | /**
* @file CVodesIntegrator.cpp
*/
// Copyright 2001 California Institute of Technology
#include "cantera/numerics/CVodesIntegrator.h"
#include "cantera/base/stringUtils.h"
#include <iostream>
using namespace std;
#include "sundials/sundials_types.h"
#include "sundials/sundials_math.h"
#include "sundials/sundia... |
3945cc5ba03dbc4eff0e2a1880b5b23af4ab61f3 | 0877fe9fb74d63a84abd08bf107e6cebcc711ee2 | timblechmann/nt2 | /modules/core/swar/unit/simd/splatted_first.cpp | C++ | cpp | 2,857 | permissive | //==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// ... |
447322976658ece8fa0ad0542b3787306457fc66 | c22ad3086fddc9df2896cc359a27456a3532929d | kartikk98/Problem-Solving-IB-Series | /Trees/SortedArrayToBST.cpp | C++ | cpp | 696 | no_license | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
TreeNode* solve(const vector<int> &A, int low, int high)
{
if(low>high)
return NULL;
int mid = low + ... |
a88db79c60ca30a7890a3a2d08035deb838a5b50 | c54de62f6e578aedbcb15313d0cca815bcc32f32 | gpeal/Arduino | /libraries/AP_GPS/AP_GPS_UBLOX.cpp | C++ | cpp | 5,476 | no_license | // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
//
// u-blox UBX GPS driver for ArduPilot and ArduPilotMega.
// Code by Michael Smith, Jordi Munoz and Jose Julio, DIYDrones.com
//
// This library is free software; you can redistribute it and / or
// modify it under the terms of the GNU... |
787514d4e2b60927ff54cfa2a750963866c303ba | f53115a27b639d72726f7f80fc59adb9d9dc44d4 | davidfobar/BrewController | /lib/RotaryInputClass/RotaryInputClass.cpp | C++ | cpp | 2,177 | no_license | #include "RotaryInputClass.h"
RotaryInputClass::RotaryInputClass(int pin1, int pin2, int butPin) : rotaryInput(pin1,pin2){
pin = butPin;
pinMode(pin, INPUT_PULLUP);
rotaryUpdate = noRotaryUpdate;
curButState = LOW;
prevButState = LOW;
debouncing = false;
enabled = false;
firstLook = true;
prevRotaryT... |
cdb72f25b9bfa00b0d94d13d3652dd5a7eb96724 | 41386f0dc067593cbdee05e242cfb708dc0ea2d8 | hohaidang/CPP_Basic2Advance | /LeetCode/LinkListCycleII/Source.cpp | C++ | cpp | 3,283 | no_license | #include <iostream>
#include <unordered_map>
using namespace std;
struct SingleListNode {
int val;
SingleListNode *next;
SingleListNode(int x) : val(x), next(nullptr) {}
};
class MyLinkedList {
public:
SingleListNode *pHead;
SingleListNode *pTail;
MyLinkedList(SingleListNode *node) : pHead(node), pTail(node) {}... |
8f664b8bd5bf2673a9bc2c36e257a97ca88f46bc | dc870a3fcc720397c932c7a9bbfccb62fdf71fc9 | kirsan31/lib_ui | /ui/basic_click_handlers.cpp | C++ | cpp | 4,876 | no_license | // This file is part of Desktop App Toolkit,
// a set of libraries for developing nice desktop applications.
//
// For license and copyright information please follow this link:
// https://github.com/desktop-app/legal/blob/master/LEGAL
//
#include "ui/basic_click_handlers.h"
#include "ui/widgets/tooltip.h"
#include "u... |
de0afd430d1b2cc0267f90f31928340194873624 | 6ca3cb35e186af6f5d1be6bb25ca519edd7bc1ce | ryanberryhill/pme | /src/pme/minimization/sisi.cpp | C++ | cpp | 7,746 | permissive | /*
* Copyright (c) 2018 Ryan Berryhill, University of Toronto
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy,... |
8f8d9648fccfc59356b5493b35045e74ef5b2741 | a79719eaecc12861f49ce4f5890d7b3dd932a66f | hal2069/Faasm | /tests/test/upload/test_upload.cpp | C++ | cpp | 11,381 | permissive | #include <catch/catch.hpp>
#include <util/bytes.h>
#include <util/environment.h>
#include <util/files.h>
#include <redis/Redis.h>
#include <upload/UploadServer.h>
#include <boost/filesystem.hpp>
#include <storage/FileLoader.h>
#include <state/State.h>
using namespace web::http::experimental::listener;
using namesp... |
05279bd009b18977f8533401628567a8ddbc8102 | 04aee4eddf050086cab181e408c0091444f9d60d | naeema-19/Mission-Impossible | /CodeChef/DSA/Easy/findmeli.cpp | C++ | cpp | 356 | no_license | #include <iostream>
using namespace std;
int main()
{
int n,k,f=0,j;
cin>>n>>k;
for(int i=0;i<n;i++)
{
cin>>j;
if(j==k)
{
f=1;
break;
}
}
if(f==1)
{
cout<<1<<endl;
}
else
{
cout<<-1<<e... |
124b6be5753007a95595f7d66ad4871a4062cb48 | a04c4d2eec90225e2e888faef6c1613eac92f5cf | bluaxe/TNN | /test/unit_test/layer_test/test_neg_layer.cc | C++ | cc | 1,141 | permissive | // Tencent is pleased to support the open source community by making TNN available.
//
// Copyright (C) 2020 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 o... |
c7e64f842aca8d1f4095cc989c6946f0def81290 | 18ef3d9943247a3b7118e9797e2f4f5d8417d0d1 | undomiel17/matmeh-MMM-programming-practice- | /1 семестр/2019.09.19/задача 8.cpp | C++ | cpp | 1,541 | no_license | #include <iostream>
#include <cstring>
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
struct str {
private: unsigned int dl; char* s;
public:
str (char*st){
dl=strlen(st);
s=new char[dl+1];
for (unsigned int i=0;i<dl;i++){s[i]=st[i];}
s[dl]='\0';
}
str (){
dl=5;
... |
326ed02df3653acc30ebe4a476140ce213e419b5 | 89eb2843d50c858e738c5215c66d9c86befedf06 | WeTruth/ffead-cpp | /src/modules/threads/ThreadPool.cpp | C++ | cpp | 4,247 | no_license | /*
Copyright 2009-2012, Sumeet Chhetri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... |
c5943e6b95352685dd83026c2ecfe83f1d3d07d5 | 2629a95769f3d016d257bfb1d726cec9889b17e0 | UBERROMS/frameworks_base | /cmds/bootanimation/BootAnimation.cpp | C++ | cpp | 41,515 | permissive | /*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... |
1ef0832fb725c9fff570b6833099eccc6cdd94c4 | cd9be57742ffc221d69cdca42aae49432e68a300 | yecol/aws-sdk-cpp | /aws-cpp-sdk-apigateway/source/model/GetSdkTypeRequest.cpp | C++ | cpp | 948 | permissive | /*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" fil... |
a901c519247e759d6846669fcaf049f86adf4525 | 34f30bf4300bfef11080292becb6cfc8324f3b5a | stone-SJH/Computer-Graphics | /scrum2/Flag.cpp | C++ | cpp | 3,868 | no_license | #include "Flag.h"
GLfloat Flag::getcurve(int pos){
GLfloat result;
if (tp == Sin)
result = range_now * sin(pos * theta_inc + theta);
else if (tp == Cos)
result = range_now * cos(pos * theta_inc + theta);
//cout << result;
return result;
}
void Flag::setNormal(const GLfloat v1[3], const GLfloat v2[3], const G... |
47bcddb717f32272d9e321b09010658cfeade42d | 42cda78b2fc2e8feed915d4b1299ccc33c23c5a5 | nbu-gamedev/gwars-2015 | /GWars/Timer.cpp | C++ | cpp | 1,706 | no_license | #include "Timer.h"
Timer::Timer()
{
this->startTicks = 0;
this->pausedTicks = 0;
this->paused = false;
this->started = false;
}
void Timer::Start()
{
this->started = true;
this->paused = false;
this->startTicks = SDL_GetTicks();
this->pausedTicks = 0;
}
void Timer::Stop()
{
//Stop the timer
... |
73c3713e0a4b0473b6ba43b8097848c8aa841e54 | f36268856bda334066fc62baf80415b1745a33a2 | random-builder/design_cadquery_ocp | /src-macOS/BRepPrim.cpp | C++ | cpp | 12,987 | no_license |
// std lib related includes
#include <tuple>
// pybind 11 related includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
// Standard Handle
#include <Standard_Handle.hxx>
// includes to resolve forward declarations
#include <BRep_Builder.hxx>
#include <Geom_Surface.hxx>
#inclu... |
5c1edd0faa690fd8f6fafca3204443ae21921574 | 2598e4911e36ebca9a292d39e4797395c6424bfc | dos5gw/TMeter | /TimeTickDlg.cpp | C++ | cpp | 3,260 | no_license | // TimeTickDlg.cpp : implementation file
//
#include "stdafx.h"
#include "tmeter.h"
#include "TimeTickDlg.h"
#include "XrfInstrument.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CSpectrumInfo<DWORD,SPEC_SIZE> g_SpectrumInfo;
//////////////... |
aaa87c5834cf67774de2b2c2d1d8c24820a5ea8e | 483ea02a7bca9cf1b6a1e99326f42d1ae2b7e671 | google/filament | /third_party/draco/src/draco/compression/mesh/mesh_encoder.cc | C++ | cc | 1,068 | permissive | // Copyright 2016 The Draco Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
1dd481ec903ae33397c595f7e03831bb52637b5d | 9cfaf49473b0d7a59a166ad6c142eb7b757764d8 | OtavioPellicano/RegrasDeDescarte | /IntensidadeDeSinal.cpp | C++ | cpp | 955 | no_license | #include "IntensidadeDeSinal.h"
namespace opmm {
IntensidadeDeSinal::IntensidadeDeSinal(const std::string &medicaoSinal, const conexao &tipoConexao)
{
//Testando se o valor é numérico
try {
mMedicaoSinal = std::stod(medicaoSinal);
} catch (...) {
setMedicaoValida(false);
return;
... |
34b53466466cf86b0c36ec781b6804fa938b3fdd | 66f5f4971ef3103b4ade79b420b1664c65a14d07 | satisfactorymodding/SatisfactorySDK | /SDK/FG_Desc_ConveyorLiftMk4_classes.hpp | C++ | hpp | 698 | no_license | #pragma once
// Satisfactory SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "FG_Desc_ConveyorLiftMk4_structs.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// Bl... |
4b2d2524b17e44a527410ae934bb954046189247 | 79d360b7e93aea746ac7f2e9fdf1592353dfe784 | jaredtao/QtOpenGL | /material/src/cube.cpp | C++ | cpp | 4,954 | permissive | #include "cube.h"
#include <QVector2D>
#include <QVector3D>
#define GET_ARRAY_LEN(array) (sizeof(array) / sizeof(array[0]))
struct VertexData
{
QVector3D position;
QVector2D texCoord;
};
const QVector3D Coords[] = {
// v1 front top left
QVector3D(-1.0f, 1.0f, 1.0f),
// v2 front top right
QVector3D(1.0f, 1.0f, 1... |
1ba92917b172b8fac5ec9ab2ba2182f81dce0158 | 0e958f286b91046eb5a0a7368bbf1ec6c94701a2 | FreekDS/BrainFuckVM | /BrainFuckVM.cpp | C++ | cpp | 244 | no_license | #include "BrainFuckVM.h"
using namespace bfm;
void BrainFuckVM::run(Program *program) {
m_tape.clear();
m_tape = tape(30000);
program->setTape(&m_tape);
program->run();
}
BrainFuckVM::BrainFuckVM()
:m_tape(30000) { }
|
41ff3ba0bd9858aff94c5532c4924350ef19b2a7 | af6f5c2191245ee9083b8ceffef6b82bb20ac590 | ruiwng/program | /leetcode/ugly_number_ii.cpp | C++ | cpp | 956 | no_license | #include <stdio.h>
#include <stdlib.h>
int nthUglyNumber(int n) {
int *arry = (int *) malloc(sizeof(int) * n);
arry[0] = 1;
int index_2 = 0;
int index_3 = 0;
int index_5 = 0;
int current_pos = 0;
while(current_pos != n-1)
{
int value_2 = arry[index_2] * 2;
int value_3 = arry[index_3] * 3;
... |
d63eaf8b3aad7fa4bea88ab93c3786c9d49a88f8 | ea11c03804a66023adbc726f9d729a4202ed1bf4 | cicero884/Geometry | /objects/card_slot.cpp | C++ | cpp | 3,173 | no_license | #include"card_slot.h"
extern MainWindow *w;
extern QVector<QGraphicsItem*> GameImage;
extern QVector<unit*> NewBorn;
extern QVector<unit*> army;
extern QVector<unit*> boss;
extern QTimer *DemoClock;
QVector<card_slot*> cardSlots;
card_slot::card_slot(QPointF _position,QSize _diameter,unit *_exhibit)
:object(_pos... |
b6fb42270d112f491a573ae8a9e2ada478c26df2 | 25c29a8ab5adf1adfbabf2428a8fa15a2f8fde47 | ddarkclay/programming-cookbook | /C++ Programs/Function Overloading/3_armstrong_addition.cpp | C++ | cpp | 679 | no_license | #include<iostream>
#include<conio.h>
using namespace std;
class complex
{
public :
void function(int a)
{
int sum = 0,num,r;
num=a;
while(a>0)
{
r = a % 10 ;
sum = sum + (r * r *r);
a = a/10;
}
if(num == sum)
cout<<"\n"<<num<<" is an Armstrong number";
else
... |
1406d8e91208d9375335a7fc9af5882a77e448a4 | 1c42df011c7abc72a73b02388b3c71915a30e88f | tlsdorye/Problem-Solving | /BOJ/10757.cpp | C++ | cpp | 748 | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <string>
#include <cmath>
#include <map>
#define INF 987654321
typedef long long ll;
using namespace std;
int main()
{
string n, m;
cin >> n >> m;
if (n.size() < m.size()) swap(n, m);
vector<int> d(n.size() + 1,... |
1229f56d97715e67acec884e9d5a20847c3a6a72 | d2688620b0c3d20625b015a2eb2c942c94d26e14 | TongqiZhu/tvm | /src/relay/pass/pass_manager.cc | C++ | cc | 19,036 | 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 ... |
124241441d622a68dc01d1d23379df8dee123ca3 | 447f34dc5e96cbe819b12d32df78f16b93412ca3 | keerthanashanmugam/graphlabapi | /toolkits/computer_vision/stitching_detailed.cpp | C++ | cpp | 27,821 | permissive | /*
* Copyright (c) 2009 Carnegie Mellon University.
* 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.... |
5086d8d82375fe7f5082a5613d3bf6b016d47d32 | 1c1abfd896df3a60e61d67fb5ebd06f7ebdccbab | shmuga/dotfiles | /c/template.cpp | C++ | cpp | 1,314 | permissive | #include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::val... |
f8c48a582f847c42e421230734829bd8a53d964e | 5856a279b3d328f0fd8ff133704ad65dc876817d | TheWiseCode/Pack-ED1-2-2020 | /Ayudantia Examen 1/3.Polinomio/Polinomios/UPoliLP.cpp | C++ | cpp | 4,342 | no_license | // ---------------------------------------------------------------------------
#pragma hdrstop
#include "UPoliLP.h"
// ---------------------------------------------------------------------------
#pragma package(smart_init)
PoliLP::PoliLP() {
pol = new ListaP();
}
direccionP PoliLP::buscar_exponente(int exp) {
if ... |
2a53bfc41e12624e80be02cf34d1e0db2353b59a | 3fdb83b096f62975b3b169a09a1dfba2b2e8d9a1 | aurantst/windows-XP-SP1 | /XPSP1/NT/com/ole32/ole232/base/api.cpp | C++ | cpp | 67,071 | no_license | //+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1993.
//
// File: api.cpp
//
// Contents: OLE2 api definitions.
//
// Classes: none
//
// Functions: OleRun
// OleIsRunning
// ... |
36d49a0558c15028dc39f1ec92ee53048189515b | d4ad155bec49d31292f8595d21d4c184ff9959b6 | dragly/photonflow | /tools/builder/main.cpp | C++ | cpp | 401 | no_license | #include <QApplication>
#include <QQmlApplicationEngine>
#include "neuronsimulator.h"
#include <vendor.h>
int main(int argc, char *argv[])
{
qmlRegisterType<NeuronSimulator>("Photonflow", 1, 0, "NeuronSimulator");
QApplication app(argc, argv);
QQmlApplicationEngine engine;
qpm::init(app, engine);
... |
97fd096621a67fae939d0790a608863c5f55f10f | 7805acb4cfbf6859cffb83df408caf078387c551 | yoyofr/modizer | /libs/libopenmpt/openmpt-trunk/mptrack/PatternFindReplace.cpp | C++ | cpp | 19,715 | permissive | /*
* PatternFindReplace.cpp
* ----------------------
* Purpose: Implementation of the pattern search.
* Notes : (currently none)
* Authors: Olivier Lapicque
* OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#include "stdafx.h"
#include "Main... |
d7bcfbea310d644737a4d25c9c18b8ba13f68673 | ee13577eca88b4702b07306fc6f0927e7dadf8e1 | Andresrodart/Hobbies | /VJudge/QueryOnArrays.cpp | C++ | cpp | 1,778 | no_license | #include <set>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
class fenwick{
private:
vector<ll> arr;
ll lenght;
public:
fenwick(ll n);
fenwick(vector<ll> arr, size_t n);
void update(ll l, ll delta);
void replace(ll l, ll de... |
6b190b543642ac294066510bf9149693afa72646 | 1ea4bceb95d2101789f6663620af45682cf86968 | IsraMekki/tiramisu_code_generator | /cmake-build-debug/programs_tiling/function14630/function14630_schedule_25/function14630_schedule_25.cpp | C++ | cpp | 2,217 | no_license | #include <tiramisu/tiramisu.h>
using namespace tiramisu;
int main(int argc, char **argv){
tiramisu::init("function14630_schedule_25");
constant c0("c0", 64), c1("c1", 64), c2("c2", 128), c3("c3", 64);
var i0("i0", 0, c0), i1("i1", 0, c1), i2("i2", 0, c2), i3("i3", 0, c3), i01("i01"), i02("i02"), i03("i0... |
8435c8d512d32737e1cc410a8ceb430d06ac768d | d9c88accee086923706e7a3354165232b56f8526 | IvanIsCoding/OlympiadSolutions | /DMOJ/coci14c1p6.cpp | C++ | cpp | 2,130 | no_license | // Ivan Carvalho
// Solution to https://dmoj.ca/problem/coci14c1p6
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
const ll MAXN = 5 * 1e5 + 10;
vector<ii> grafo[MAXN];
ll n, k, especiais[MAXN], marcado[MAXN], raiz, aux, processado[MAXN];
ll best, pesototal, resposta[MAXN], ... |
9416e6f681091804334746dac0c21e34e0ec5689 | 3057b43de1a0c73cf0f95cbbc59282f90cf5a046 | KhalilBellakrid/lib-ledger-core | /core/test/lib/boost/boost/hana/first.hpp | C++ | hpp | 1,287 | permissive | /*!
@file
Defines `boost::hana::first`.
@copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_FIRST_HPP
#define BOOST_HANA_FIRST_HPP
#include <boost/hana/fwd/first.... |
16901a295bcea4312458d3274eb0d812005f0b25 | 12d21048d675646ef0ac785d692ded9dee265602 | Gr3yR0n1n/qFlipper | /streamparser.cpp | C++ | cpp | 744 | no_license | #include "streamparser.h"
#include <QDebug>
StreamParser::StreamParser(QObject *parent) : QObject(parent),
header(QByteArray::fromHex("F0E1D2C3")),
buffer(),
found(false)
{
}
void StreamParser::feed(QByteArray data) {
buffer += data;
if (!found) {
int pos = buffer.indexOf(header);
... |
9caa6510c04fd2014ac5a45a4da07f517b9202dd | 1694193c1dbcdb3bc716010aa3b6ca5eaf60841c | pkvijay/metaDR | /libClient/endPoint.cc | C++ | cc | 560 | permissive | #include "include/endPoint.h"
#include <stdexcept>
using namespace std;
EndPoint::EndPoint(const string& endpoint)
{
size_t pos = endpoint.find_first_of(':');
if (pos == string::npos) {
cerr << "Endpoint, " << endpoint
<< " should be provided in hostIp:portNum format" << endl;
throw inval... |
62b3ef23632b94ff96ad8dcca8792db66cde3ee4 | fd60e1c2e72f249c6ce236db55e234252242cb6a | zengjichuan/KOIL | /online.cpp | C++ | cpp | 5,283 | no_license | /**
* @brief Kernelized Online Imbalanced Learning with Fixed Buddget
* Implemented by Junjie Hu
* Contact: jjhu@cse.cuhk.edu.hk
*/
#include "svm.h"
#include "KOIL.h"
#include "utility.h"
#include <iostream>
#include <cmath>
#include <vector>
#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>
#include <mut... |
7534debd95e129b3fe73821fa1d285251c922de0 | 7fe60bdf01aff91ffbe8e283c758d856f80b357c | MukulMadaan/GeeksMustDo | /StackAndQueue/MaxOfAllSubarrayOfSizeK.cpp | C++ | cpp | 1,498 | no_license | //SLIDING WINDOW
using namespace std;
int maxFun(vector<int> arr, int s, int k){
int res = INT_MIN;
for(int i = s ; i < s + k; i++){
res = max(arr[i], res);
}
return res;
}
int main() {
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
vector<int> arr;
vector<int> res;
for(in... |
fed7ae4b4da1949d7bfc5145338c68e0d9a9f398 | 887271d762ac28d9b727f63129ca192e00f32d03 | orcchg/CppCourse | /Lesson_12/condition_variable/solutions/condition_variable_5_1.cpp | C++ | cpp | 2,818 | no_license | #include <atomic>
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <thread>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include "logger.h"
bool stopped = false;
void tick() {
std::this_thread::sleep_for(std::chrono::seconds(3));
stopped = true;
}
/* Semaphore */
// ----------... |
27d3a59f9a24b16d310618ab062208c7a3f84467 | aeffb5e400d4d924944d56c11f8862da0c224067 | TomatoClock0/TomatoClock_team | /TomatoClock/mainwindow.cpp | C++ | cpp | 1,144 | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include "completed.h"
#include "clock.h"
#include "settings.h"
#include "addtasks.h"
#include "managetasks.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.