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 |
|---|---|---|---|---|---|---|---|---|
272127b8388f26adf5ca937abcc9e05a90b197db | 46a6fd4c67752ad19d6737c980a7c5b5ee4d5ede | SilviuCristian45/Probleme-Info-11G | /Clasa_11/countprimsub/main.cpp | C++ | cpp | 975 | no_license | #include <bits/stdc++.h>
using namespace std;
ifstream fin("countprimsub.in");
ofstream fout("countprimsub.out");
int nd[1005], n, k, nr[1005], val[1005], dr[1005], st[1005], r[1005];
bool prim(int x)
{
if(x < 2) return false;
for(int i = 2; i * i <= x; i++)
if(x % i == 0) return false;
return ... |
2ab3113179cf66ed1d8eb108f1e2c18785284b6e | ec9e06862a25e444bbac22c1338ed83bdb21f7c5 | Tkachesters/exam | /exam/answers/src/1.cpp | C++ | cpp | 1,031 | no_license | #include "iostream"
#include "fstream"
using namespace std;
struct Data {
int key;
char data;
};
void BubbleSort(Data *arr, int n) {
// Устойчивая сортировка пузырьком, попарное сравнение - максимальный элемент уходит в конец
Data temp{};
for (int i = 1; i < n; i++) {
for (int j = n - 1;... |
6e610c95272fa9cf05a919548a7688f7c5246e30 | 0d990b19ff3cd1dada8764eefefb4a2bf0a59baa | governmentbg/EPEP_2019_d2 | /CAC_Source_1.7884/connect/ConnectDialog.cpp | C++ | cpp | 4,725 | no_license | #include "cac.h"
DEFINE_RESPONSE_TABLE1(TConnectDialog, TDialog)
//{{TConnectDialogRSP_TBL_BEGIN}}
EV_BN_CLICKED(IDOK, OKBNClicked),
EV_CBN_SELCHANGE(IDC_CONNECT_ALIAS, AliasCBNSelChange),
//{{TConnectDialogRSP_TBL_END}}
END_RESPONSE_TABLE;
//{{TConnectDialog Implementation}}
TConnectDialog::TConnectDialog(TWindow... |
8a960bf7b64a3980884c1be93ab4cb590f24d40c | ccbba1484389986a791645731661ce087296255c | zch0423/leetcode | /204.计数质数.cpp | C++ | cpp | 1,141 | no_license | /*
* @lc app=leetcode.cn id=204 lang=cpp
*
* [204] 计数质数
*/
// @lc code=start
class Solution {
public:
int countPrimes(int n) {
// time limit
// if(n<3){
// return 0;
// }
// int s = 0;
// bool flag=true;
// vector<int> prime = {2};
// for(int ... |
e3e48ffa117bd91c1f6e63951c0ca45f0589b901 | 7c3fdecca519dcb6a83bcbff7702ddce5c872fa5 | mweschler/SPEng | /src/Tests/InputHandlerTest.cpp | C++ | cpp | 9,258 | permissive | #include "gtest/gtest.h"
#include "InputHandler.h"
#include <SFML/Audio.hpp>
#include <windows.h>
#include <conio.h>
//If this test gives you an error. It means you were pressing up
TEST(userInputTest, DISABLED_test_one)
{
UserInput input;
bool test =input.isKeyPressed(sf::Keyboard::Up);
input.isKeyPressed(sf::Keyb... |
9a53f752ac86e34c54840d2639ce26e0f2fa018b | d8109d2c684ff632f0213764ba73f6b6a5aa3a7c | mtheuniss/Bomberman | /Bombe.cpp | C++ | cpp | 2,330 | no_license | #include "Bombe.hpp"
/*
Ce constructeur n'est appelé que lorsque les joueurs sont créés : les bombes lancées au cours du jeu sont des copies de celle ci
Ainsi lors de l'appel de ce constructeur, la bombe n'est pas posée d'où sa position à 0.
*/
Bombe::Bombe(){
_pos.x = 0; _pos.y = 0;
_rayon = 2;
_type = 0;
thi... |
565745c5efff77c6553306728a887a375ed62323 | 4aecc1136fe964d063be5d31580d6633c853036a | gem-sw/cmssw | /RecoLocalCalo/HcalRecAlgos/src/HcalHF_PETalgorithm.cc | C++ | cc | 6,578 | no_license | #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHF_PETalgorithm.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalCaloFlagLabels.h"
#include "CondFormats/HcalObjects/interface/HcalChannelQuality.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeveri... |
2e908b5bfe3287f15dc59cee8b0a0e45312b0fa7 | f4ee0b29d23dae727b3b37e6fdaa73d5e6e318e4 | robotics1714/2015-Code | /src/XboxController.cpp | C++ | cpp | 2,048 | no_license |
/*
* File: XboxController.cpp
* Description: cpp file for the XboxController, making it easier to instantiate an xbox controller
* Last Changed: 1-19-13 borderline 1-20-13 :D
* Author: Matthew W
*/
#include "XboxController.h"
#define LEFT_X 0
#define LEFT_Y 1
#define LEFT_TRIGGER 2
#define RIGHT_TRIGGER 3
#def... |
6758791808af2e222e5d773dbc1c79906a62ec35 | 90661665d7c8584308153a09fce30b3e9f06e45c | palcu/algo | /HomeworkNov2009/13.CPP | C++ | cpp | 232 | no_license | #include <iostream.h>
void main()
{
int n,l1,l2,l3,i,nr=0;
cin>>n>>l1>>l2; n-=2;
for (i=1;i<=n;i++)
{
cin>>l3;
if ((l1+l2>l3)&&(l1+l3>l2)&&(l2+l3>l1)&&(l1>0)&&(l2>0)&&(l3>0))
nr++;
l1=l2; l2=l3;
}
cout<<nr<<endl;
} |
6b172edf8dd823d99c8d0fb8e6f526c1337ab665 | 0605d69d0e45d0c4ec5c5650866abc2bba49625e | imulan/procon | /atcoder/abc018/c.cpp | C++ | cpp | 940 | no_license | #include <cstdio>
#include <iostream>
using namespace std;
int main(){
int r, c, k;
char f[510][510];
scanf(" %d %d %d", &r, &c, &k);
for(int i=1; i<=r; ++i)
for(int j=1; j<=c; ++j)
scanf(" %c", &f[i][j]);
long ans=0;
int t=k-1;
for(int x=k; x<=r-k+1; ++x){
for(int y=k; y<=c-k+1; ++y){
bool ... |
474a83c607528582b999b7126ddfb2908846dbf6 | 3580c2b7e9f77c782d47d54696064d33cb3ac4dc | moneyman101k/coding-challenges | /seatgeek-coding-challenge/backendchallengesolution/datasync.cc | C++ | cc | 1,866 | no_license | // SeatGeek Backend Challenge 2 - Data Center Recovery
// Name: Maneesh Karipineni
// Date: 4/9/16
#include <iostream>
#include <set>
#include <vector>
using namespace std;
int main(int argc, char *argv[]){
int num_centers;
int i;
char data_centers[1000];
cin.getline(data_centers, 1000);
num_centers = a... |
53dbfe166362351e31c13cf2650b059ca348294f | 27335d9b64f7733ff991d905c14ac92b241f84c0 | S-S-Sroy/CC_Coding | /ZPractice/Recursion/print_subset_array2.cpp | C++ | cpp | 708 | no_license | #include<bits/stdc++.h>
using namespace std;
void print_subset(int input[],int startIndex,int n,int output[],int m){
//1.Base Case
if(startIndex==n){
for(int i=0;i<m;i++){
cout<<output[i]<<" ";
}
cout<<endl;
return;
}
//2.Recursion
int small_output[40],s... |
52879e9926d4638665cdf95e8c687ba93c6bceb5 | fe89972b70776e4b9d27f55d47a3a44f802636e5 | dreamJarvis/Problem_Solving | /arrays/twoSumSortedArray_2.cpp | C++ | cpp | 823 | no_license | #include <bits/stdc++.h>
using namespace std;
vector<int> twoSum(vector<int> &numbers, int target) {
vector<int> result;
vector<int> unique;
unique.push_back(numbers[0]);
for(int i = 1; i < numbers.size(); i++){
if(unique.back() != numbers[i]){
unique.push_back(numbers[i]);
... |
4419de1897cca3f8c917a5d9d0c433de5fda5d04 | f4bbb81f8e7c6cf582903df7c03782fb6de088d8 | longtuanquang/C- | /C++/Lectures/Functions/gcd.cpp | C++ | cpp | 564 | no_license | #include <iostream>
#include <iostream>
using namespace std;
int main(){
// Prompt user for input
int num1,num2;
cout << "Please enter two integers: ";
cin >> num1 >> num2;
// Determin the smallest number b/w two numbers
int min = (num1 < num2) ? num1 : num2;
// 1 is denefintely a common fa... |
11aa7899e715395f8759a9d3f045e66b9ec19cdb | 915e686727a1b75e949fe7def2d9d68276710010 | lulu10922/codes | /phonecombination/main.cpp | C++ | cpp | 976 | no_license | #include <iostream>
#include<string>
#include<vector>
#include<unordered_map>
using namespace std;
//还是用回溯法,注意输入大小为0时的情况
class Solution {
public:
void dfs(vector <string> & res,string & tmp,string digits,int cur,int size,unordered_map<char,string> map)
{
if(cur==size)
{
res.push_back(tmp);
ret... |
cb46a40d5b27706d87e345ebd2e557102f5c4714 | ecb614bb5b5b4c7eb17bc821097e521b2f269ca6 | wen96/pl-man2 | /masternetwork/src/CNetworkServerDispatcher.cpp | C++ | cpp | 5,581 | permissive | #include "CNetworkServerDispatcher.h"
#include "CNetworkServer.h"
#include "CLog.h"
#include <boost/tokenizer.hpp>
#include <vector>
#include <string>
///////////////////////////////////////////////////////////////////////////////
/// \brief Constructs a dispatcher
////////////////////////////////////////////////////... |
3fbd738141b018a989781957f063fec6d1a1b892 | c5ec1bb12be4edc336cb051da79449f9b97f810f | SiChiTong/scrubbber_slam_CMES | /m3/src/core/mt_search/multi_thread_search.cc | C++ | cc | 17,651 | no_license | //
// Created by gaoxiang on 2020/9/22.
//
#include "core/mt_search/multi_thread_search.h"
#include "common/mapping_math.h"
#include "common/std_headers.h"
#include "core/mem_control/mem_control.h"
#include "core/ndt_omp/include/pclomp/ndt_omp.h"
#include "core/resolution_matching/matcher/multi_resolution_matcher.h"
#... |
5b74b03be9379dd2246e48c441e31fb9547e606d | 131b6ed05a562cb313ab4048d69bfc3b0e9a35c9 | Vizionnation/chromenohistory | /jingle/glue/network_service_config_test_util.cc | C++ | cc | 4,786 | permissive | // Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Helper for tests that want to fill in a NetworkServiceConfig
#include "jingle/glue/network_service_config_test_util.h"
#include <memory>
#inclu... |
d9411b1158c6be6bcffb84eefb97096b55decc7c | fef1cf7827f67fc0baa576e70949f5f1b98ba080 | pedmarq/kmts-repair | /src/Leitor.cpp | C++ | cpp | 1,484 | permissive | #include "Leitor.h"
#include <cstdlib>
#include <iostream>
// #include "lex.yy.c"
#include "Formula.h"
#include "VisitTree.h"
#include "scanner.c"
#include "Estado.h"
#include <map>
using namespace std;
extern int yyparse();
extern Formula *principal;
extern list<Estado> estadosLidos;
extern list<TransicaoTemp> trans... |
82711935ace914346a6a806a2f406288c633a706 | 70b3e0cd83cb80e60fe09fd6369f8e4e8be1a9b3 | aignacio/NetworkOnChip | /test/slaveshell.cpp | C++ | cpp | 898 | no_license | #include "slaveshell.h"
#include "nocdebug.h"
SlaveShell::SlaveShell(sc_module_name name) :
sc_module(name)
{
SC_THREAD(_threadRun);
}
void SlaveShell::_threadRun()
{
int rec;
char send;
for (;;) {
// Reading
std::vector<uint32_t> payload;
int payloadSrc;
NoCDebug:... |
68491b3316b46348a5c6ebd49f830a656e0954aa | 3de95d3ae13dac726acae9ecbf38ca1a11ad074e | tfels/OffHook | /src/Jabra.cpp | C++ | cpp | 6,968 | no_license | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <JabraNativeHid.h>
#include "json-parser/json.h"
#include "Jabra.h"
#include "MainDialog.h"
//#define JABRA_SDK_EMULATION
#ifdef JABRA_SDK_EMULATION
#pragma comment(lib, "JabraSdkEmulation.lib")
#e... |
5f560de219f78c232c5d9d5d6a076bd47f40b12d | 3098d6e1532fa1f0470fc28e2ef70dd9263bebdc | TeamVault/tauCFI | /C++ Benchmark Programs/Benchmark Files 1/poc/poc-clang-cfi.cpp | C++ | cpp | 1,198 | no_license | // Compile with Clang 3.8
// clang++ -fsanitize=cfi -flto -Wall -Werror -std=c++0x -O3
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
//Traditional RefCounted Interface
struct RefCounted {
// Empty method bodies, because they are never used in POC
virtual void addRef() {}
virtual vo... |
a628ba5a1eedf3589cf3e2605c4b026b55f1419b | 57052efe171c8d90417b394a177000c1bd9ddf4d | lukaa12/TKOM-simple_language_interpreter | /src/stdlib/Functions.cpp | C++ | cpp | 6,027 | no_license | #include "Functions.h"
#include "../Error.h"
using namespace tkom;
using namespace lib;
GLuint compileShaders();
GLFWwindow* initWindow(GLuint w, GLuint h);
// Shaders
const GLchar* vertexShaderSource = "#version 330 core\n"
"layout (location = 0) in vec2 position;\n"
"uniform mat3 transform;\n"
"void main()\n"
"{\n... |
4f3e763bb2af643065e7ca915186fc192911c8e9 | 508dd69474afb8e84efedf3f044bbaa14ab788d4 | 457251763/LeetCode | /T237.删除链表中的节点/题解.cpp | C++ | cpp | 306 | no_license |
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void deleteNode(ListNode* node) {
node->val=node->next->val;
node->next = node->next->next;
}
};
|
b3cd949deec0ff823e19c26ea8eceb5b0c81c23d | dfaefec2c6ae399835ec9d4314b6af6d1d4c37fa | RDTCREW/SoT-SDK | /SDK/SoT_bsp_bush_cluster_02_c_parameters.hpp | C++ | hpp | 495 | no_license | #pragma once
// SeaOfThieves (1.6.4) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "../SDK.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
// Function bsp_bus... |
0a92104e928d87d1c5a4ccada5c1e143e510c094 | d664212f7bab98890ed65affff21f8a93814d407 | Akash7380/data-structure-lab | /week10/trees.ccp.cpp | C++ | cpp | 2,783 | no_license | #include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
struct node
{
int data;
struct node *left;
struct node *right;
};
typedef struct node *NODE;
NODE getnode(int data)
{
NODE x=(NODE)malloc(sizeof(struct node));
x->data=data;
x->right=NULL;
x->left=NULL;
return x; ... |
8001555895ad781cd5d15168e9d9ca18e020677d | e51723fd3897a0a77d5d1b0c284a56fdf043ad4a | bobboli/DX11 | /Chapter 8 Texturing- Textured Hills and Waves/effects.cpp | C++ | cpp | 1,952 | no_license | #include"effects.h"
#include<fstream>
#include<vector>
Effect::Effect(ID3D11Device *device, std::wstring compiledFileName) {
std::ifstream fin(compiledFileName, std::ios::binary);
if (fin.fail()) throw("Failed to open the compiled Effect file!");
fin.seekg(0, std::ios_base::end);
int size = fin.tellg();
fin.s... |
51ee923b9192caa910a74d21ffaaf7f718552054 | 478d7a29fcab05a35e5ab366e68e636ad7780682 | metahashorg/metagate | /src/Network/WebSocketClient.cpp | C++ | cpp | 5,374 | no_license | #include "WebSocketClient.h"
#include "Log.h"
#include "check.h"
#include "utilites/utils.h"
#include "qt_utilites/SlotWrapper.h"
#include "Paths.h"
#include "duration.h"
#include "qt_utilites/QRegister.h"
#include <QTimer>
#include <thread>
SET_LOG_NAMESPACE("WSS");
WebSocketClient::WebSocketClient(const QString &... |
d25ee3b5e80f6a718d663cfb62d5678f8e74620f | 7869ba796afc480b603ad95cb1d1856de95eff8a | reecekatie/UVU-Projects | /HashTable/Hash.cpp | C++ | cpp | 1,757 | no_license | //
// Hash.cpp
// HashTable
//
// Created by Katie Reece on 4/3/19.
// Copyright © 2019 Katie Reece. All rights reserved.
//
#include "Hash.h"
hashTable::hashTable(){ //no argument initializer
hash = new int[SIZE];
for(int i = 0; i < SIZE; i++){
hash[i] = -999; //initializes every value in hash ta... |
559763b10950b92cde6960d2b815ce862f56c88a | 0dc553812ee738487d0e55fe6e44537cd21fb54f | Mary0806/tg_mpei_course | /559. Maximum Depth of N-ary Tree.cpp | C++ | cpp | 507 | no_license | //https://leetcode.com/problems/maximum-depth-of-n-ary-tree/
/*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public:
int maxDepth(No... |
ffdc68c40b3fd50f4a7e68c60fc39c534744fd91 | ccd60f5b9a874cb33778baaf245e7d5eb6008901 | eurogiciel-oss/Tizen_Crosswalk | /src/chrome/browser/drive/drive_api_service.cc | C++ | cc | 32,923 | 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/drive/drive_api_service.h"
#include <string>
#include <vector>
#include "base/bind.h"
#include "base/strings/stringprintf.h... |
aee17dd6f5e9ca37eb5284baabf86b42f1b9e3a8 | 889faebbea5ec0c4bf74d27ed9ffbde80c8122f8 | ashray/VTK-EVM | /Imaging/Color/vtkImageQuantizeRGBToIndex.cxx | C++ | cxx | 20,900 | permissive | /*=========================================================================
Program: Visualization Toolkit
Module: vtkImageQuantizeRGBToIndex.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
Thi... |
ca1cfc229f8e9096f384d405d7c404eccc7fbbcf | e4c62e30c0aa0a30da0477eec52a8b1f98a68fee | nikita-veshchikov/silk | /silk/leakageFunctions.hpp | C++ | hpp | 527 | no_license | #ifndef __LEAKAGE_FUNCTIONS_HPP__
#define __LEAKAGE_FUNCTIONS_HPP__
#define _USE_MATH_DEFINES // for the definition of pi as "M_PI"
#include <cmath>
#include "util_func.hpp"
// list of standard leakage functions
template <typename DataType>
double hammingWeightOut(DataType oldValue, DataType newValue);
template <typ... |
e059247390c45f414c992a66ba0df47efdf69845 | d127df26f044b65488f5a13149e7e4876173d2da | dkulemin/cpp_Coursera | /white/week_3/constructor/incognizable.cpp | C++ | cpp | 229 | no_license | #include <iostream>
#include <vector>
using namespace std;
struct Incognizable {
int a, b;
};
int main() {
Incognizable a;
Incognizable b = {};
Incognizable c = {0};
Incognizable d = {0, 1};
return 0;
} |
3fa78d27904efc7f75a3e0300d8bfe5e6ff1d961 | ec974bc7a926aec918765e5d873c236a9e1f5789 | heavenlybilly/olympiad | /P/acmp/Решение олимпиадных задач/11. Теория графов - 1/1. Базовые понятия/F. Космические путешествия.cpp | C++ | cpp | 790 | no_license | /*
* ------------ ЭВОЛЮЦИЯ ------------
& базовые понятия
? Если из вершины выходит более чем одно ребро, то она важная. А так как граф неориентированный, то количество ребер для вершины i равно окл-ву появлений числа i во входных данных.
*/
#include <iostream>
#include <vector>
using namespace std;
using line = vec... |
671ad1509b86ebf68aa903bb4e667513cb1db4f9 | e61662286ff371210efe3112a72d7ecb376e55f4 | GitBubble/bootstrap-ros | /dependencies/utils/log4cxx-0.10.0/src/examples/cpp/console.cpp | C++ | cpp | 3,966 | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
89dc2ff2b49e0c54851b96fa572b01d011616844 | cb65c22f3af211705b9a204748998eb4bad3c127 | FourierLzx/MachineLearning | /K-NN/main.cpp | C++ | cpp | 449 | no_license | #include <iostream>
#include "knn.h"
int main(int,char *[])
{
KNeighborsClassifier kneighborsClassifier;
if(kneighborsClassifier.train("../../../resource/dataset/Social_Network_Ads.csv")){
vector<bool> Y = kneighborsClassifier.predict({{45,41000},{47,48000},{19,18000}},5);
cout << "result:";
... |
7befbbdc36530ca86d75b4410109405d486d4ec5 | 96bb9f899a413539e8d2d022064b98abc19b0ccf | ahmad-diaa/LogDevice | /logdevice/common/test/NodesConfigurationTestUtil.cpp | C++ | cpp | 11,635 | permissive | /**
* Copyright (c) 2019-present, Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "logdevice/common/test/NodesConfigurationTestUtil.h"
#include <folly/Format.h... |
c0782d034482ffbce7e14e0d80ced6c53a3f91b9 | ea34559220efae12dd827adb53da42342c54c4c3 | Keerthu8999/PROJECT1 | /insertion and del at nth posn.cpp | C++ | cpp | 1,269 | no_license | #include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
}*top=NULL;
void insert(int x,int n)
{
struct node *temp;
temp=(struct node*)malloc(sizeof(struct node));
temp->data=x;
temp->next=NULL;
struct node *tempo;
tempo=(struct node*)malloc(sizeof(struct node));
int i;
i... |
036c081a1b98bf1d87b5b4685f80082fe32ba5ca | 2c13597b57859772d845c20a364f9c560b3c1245 | RDTCREW/SoT-SDK_2_0_7_reserv | /SDK/SoT_BP_MediumShipLanterns_classes.hpp | C++ | hpp | 2,367 | no_license | #pragma once
// Sea of Thieves (2.0) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "SoT_BP_MediumShipLanterns_structs.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//------------------------------------------------------------------------... |
272fbe4a003a10f7ada3a52d5e51faddb9339028 | 39411e3f17921aa2868d90b9bc996707bc438612 | seth1002/antivirus-1 | /Mail/Interceptors/OutlookPlugin/MAPIEDK/MAPIEDK.cpp | C++ | cpp | 5,185 | no_license | // MAPIEDK.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "MAPIEDK.h"
#include <mapiguid.h>
#include <edkutils.h>
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
... |
9d79c43bab7bfde889c41b7aa335b4b0653e6772 | 480940e3e7c8821208d30a6649e15f1c527147fe | wdiiahk/procon-archive | /atcoder.jp/dp/dp_j/Main.cpp | C++ | cpp | 5,016 | no_license | //デバッグ用オプション:-fsanitize=undefined,address
//コンパイラ最適化
#pragma GCC optimize("Ofast")
//インクルードなど
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using vint = vector<int>;
using vll = vector<ll>;
using vbool = vector<bool>;
template <class T>
using arr = vector<vector<T>>;
//マクロ
//forループ
//引数は、(ループ内変... |
87abea367ce0b58f0d1466c71499bafae83d1e31 | 3376f8990670d087b899d71cf993c04242669a93 | asincero/hello | /src/hello/main.cpp | C++ | cpp | 344 | no_license | /**
* @file main.cpp
* Implements the main() function.
*
* @author Arcadio A. Sincero Jr., <arcadio.sincero@rockwellcollins.com>
* @date 8/4/2019
*
* Copyright (c) 2019 Collins Aerospace
*/
#include "utils/person.h"
int
main(int argc, char *argv[])
{
utils::person::Person p("Arcadio Sincero");
p.say_h... |
b9b2f2a99f5b6fc01aa090a1b809086a4a2904b7 | 029b97c20a3729251cbdf49a4eff70f519ae19d2 | Alpha17-2/Fundamental | /miss.cpp | C++ | cpp | 434 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int A[n];
for(int i=0;i<n-1;i++)
cin>>A[i];
sort(A,(A+n-1));
for(int i=1;i<=n;i++)
{
if((A[i-1])!=i)
{
co... |
ff5b665832be47d96c08d3c487cb98c06d443d78 | 7fa6818ea81d0a66e9f59d207d0879c1dc415226 | joyoyao/AndroidVideo | /jni/COCOS2DX/platform/CCFileUtils.cpp | C++ | cpp | 25,811 | no_license | /****************************************************************************
Copyright (c) 2010-2013 cocos2d-x.org
http://www.cocos2d-x.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 withou... |
6b47a0554be1ca0179f98c016d0d38c89a52cae7 | 76ca2d66aa3094a1d6a04ffc9a21c754203dac02 | yurap/leetcode | /13-add-binary.cpp | C++ | cpp | 1,024 | no_license | // https://leetcode.com/problems/add-binary
#include <algorithm>
class Solution {
public:
string addBinary(string a, string b) {
string result;
int carry = 0;
for (int i = 0; i < max(a.size(), b.size()); ++i) {
int a_val = 0, b_val = 0;
if (i < a.size()... |
fc97419130d237819b7ad1d5712c8be816f5ba0a | 3bf801bae2c18ce914976787e7e3c93390187fa7 | Rydgel/twitch-player | /player/include/ui/native/win32.hpp | C++ | hpp | 419 | permissive | #pragma once
#include <string>
#include <set>
struct HWND__;
using WindowHandle = HWND__ *;
using FindWindowResult = std::set<WindowHandle>;
FindWindowResult find_windows_by_title_and_pname(std::string, std::string);
void toggle_window_borders(WindowHandle, bool);
void toggle_always_on_top(WindowHandle, bool);
vo... |
cfb7e69cbc102c1f909c0385f68b855ead03ce7f | 64370ff794e68a9a6b88c06b0a0dc4eaeced727f | dddql/cpp | /Luogu/P5707.cpp | C++ | cpp | 315 | no_license | #include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int s, v;
scanf("%d%d", &s, &v);
int time_walk = ceil(s * 1.0 / v) + 10;
int from_zero = 60 * (24 + 8) - time_walk;
int hh = (from_zero / 60) % 24;
int mm = from_zero % 60;
printf("%02d:%02d", hh, mm);
return 0;
} |
756af978abad2a3e652b590dc04a7195cd40568e | e22fb252bfd15306bf9638e8507c2079e9211450 | ORG-MARS/dragon | /dragon/operators/distributed/collective_op.cc | C++ | cc | 4,572 | permissive | #ifdef USE_MPI
#include "dragon/operators/distributed/collective_op.h"
#include "dragon/core/workspace.h"
#include "dragon/utils/math_functions.h"
namespace dragon {
template <class Context>
template <typename T>
void CollectiveOp<Context>::AllReduceMPI() {
int64_t count = src_tensor_->count();
int64_t seg_size ... |
24c89cdd187166062bf77e6c2236ea4c0d899cf7 | 32ce6d03eaf576e166457f4707c7b584ff9428db | ndojibus/coders-strike-back | /wood1.cpp | C++ | cpp | 1,605 | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
int main()
{
const int angleForMaxThrust = 90;
const int distForTheBoost... |
018194d52b7ed483c9b487c66525e4a8bf2cde34 | d6d2b998c7fe6960e4cac1f6249579e9d4d6e829 | Riverside-City-College-Computer-Science/CSC5_Winter_2014_40651 | /da2225087/LAB_02_5_14/Mark_Sort_Database/main.cpp | C++ | cpp | 1,830 | no_license | /*
* File: main.cpp
* Author: Dr. Mark E. Lehr
* Created on February 3, 2014, 8:13 AM
*/
//System Libraries
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
//Global Constants
//Function Prototypes
void filAray(int *,int *,int);
void prntAry(int *,int *,int,int);
void prntAry(int *... |
0bce5f52d7d449f1cbb7945ec8009cb6e04e645f | cb298a36def0ca58d98aa95464ed05bc393f1953 | xusiwei/bearpi-hm_nano | /foundation/multimedia/frameworks/audio_lite/audio_source/audio_source.cpp | C++ | cpp | 6,883 | permissive | /*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... |
a15f70a9521f3c885bbe27b5fe13edd4b4d6e1cd | b518110c9f4c8ca52a51c791cf84147da5ed32af | s991116/robot-projects | /Raspberry/Robocup/RaspiCamera/src/CameraNavigation.cpp | C++ | cpp | 1,358 | no_license | #include <CameraNavigation.h>
#include <unistd.h>
CameraNavigation::CameraNavigation(ComController* comController) {
_ComController = comController;
_Settings[CameraPosition::FOLLOW_LINE] = new CameraNavigationSetting(35, 54);
_Settings[CameraPosition::FIND_BOOK] = new CameraNavigationSetti... |
bb1293c648ffe4dde6b2901f89462214958c8d22 | 798cf10eeb57d99192d7aa56fe9999a7c3e7f22b | TU-Berlin-DIMA/analyzing-stream-modern-hardware | /other/streambox_saber/streambox_release_March_10_2018/Kaskade/utilities/GridGeneration/cube.hh | C++ | hh | 13,149 | permissive | #ifndef KASKADE_CUBE_HH
#define KASKADE_CUBE_HH
#include <algorithm>
#include <cmath>
#include <utility>
#include <vector>
#include <dune/common/fvector.hh>
#include "utilities/vectorTools.hh"
namespace Kaskade
{
template <class Real, int dim_>
class BasicGridElement
{
public:
static constexpr int dim =... |
06493b83abcc2967063e2cfcebf8b18e75754ff1 | 9be794838c3dc82a15567c40c095fac9a63c0982 | gkoe/leoiot20 | /libraries/sensors_actors/MiFlora/src - Kopie/MiFlora.cpp | C++ | cpp | 8,777 | no_license | #include <MiFlora.h>
#include <Arduino.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>
#include <config.h>
#include <Thing.h>
#include <ThingConfig.h>
#include <ThingTime.h>
#include <MqttClient.h>
#include <Logger.h>
#include <sstream>
#define SCAN_TIME 30 // s... |
14f7514bf687935bd5e3717947fc853688e230a6 | 7d87f7ceb64b7bc394debab2fc08dbd288b2c6cd | songpengwei/SummerCamp | /lbc/169-majority-element.cc | C++ | cc | 1,181 | no_license | /*
题目大意:
给定一个数组,求其中的众数。也就是有一个元素的个数超过了n/2了。
解题思路:
二分
遇到的问题:
一次通过。
*/
class Solution {
public:
int majorityElement(vector<int>& nums) {
auto ret = sub(nums, 0, nums.size()-1);
return ret.first;
}
pair<int, bool> sub(vector<int> &nums, int left, int right){
if(left > right){
... |
5a1b6d2a2ae7ad13abe63dcd507974278cee0941 | e0f277d1e529fe3ad5de3192284cc3b368d3e410 | ggnull35/tsduck | /src/libtsduck/tstlvSerializer.cpp | C++ | cpp | 6,440 | permissive | //----------------------------------------------------------------------------
//
// TSDuck - The MPEG Transport Stream Toolkit
// Copyright (c) 2005-2017, Thierry Lelegard
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the f... |
ab6fda168a4437b9a6ec6bd52fceb4c0ec4f5584 | afa5f2bd2b2f8c8ed1f7e2edc6fadf4441fc5f92 | 0ther/GPS | /MVC_GPS_Client/MVC_GPS_Client/ClientController.cpp | C++ | cpp | 6,103 | no_license | #include "pch.h"
#include "ClientController.h"
void CONTROLLER::Connect() {
SOCKET Connection;
WSAData wsaData;
WORD DLLVersion = MAKEWORD(2, 1);
if (WSAStartup(DLLVersion, &wsaData) != 0) {
GiveMessageToUser(ERR);
exit(1);
}
SOCKADDR_IN addr;
int sizeofaddr = sizeof(addr);
addr.sin... |
63ea48227bb7b840048dd0137db122c260c82838 | a94e9cafe166f4c88d7e4cb39fd4b2f01a35aa66 | caomenglong1/measurement-kit | /src/libmeasurement_kit/net/libevent_emitter.hpp | C++ | hpp | 8,637 | permissive | // Part of Measurement Kit <https://measurement-kit.github.io/>.
// Measurement Kit is free software under the BSD license. See AUTHORS
// and LICENSE for more information on the copying conditions.
#ifndef SRC_LIBMEASUREMENT_KIT_NET_LIBEVENT_HPP
#define SRC_LIBMEASUREMENT_KIT_NET_LIBEVENT_HPP
#include "src/libmeasure... |
b2b04bc1ec4933819141ada2cf2b65ca277ebbda | 7051c003861eed31e1887fb062cd26f63be822e8 | johnaparker/GranSim | /src/geometry_2d.hpp | C++ | hpp | 684 | no_license | #ifndef GUARD_geometry_2d_h
#define GUARD_geometry_2d_h
#include "vec.hpp"
template <typename T> int sgn(T val) {
return (T(0) < val) - (val < T(0));
}
class Circle {
public:
Circle(vec2 position, double radius, double mass, double young_mod, double friction, double damp_normal, double damp_tangent)... |
ee261f8514510ce4dcba1d49e206e41a3401787f | 8d8a29d76b41bb791d4cc20e13bda1d78b092c7d | soyccan/luaOpenCV | /test/test_draw.cc | C++ | cc | 5,527 | permissive | #include <opencv2/opencv.hpp>
#include <kaguya/kaguya.hpp>
#include <gtest/gtest.h>
#include "luaopencvtest.hpp"
TEST_F(LuaOpenCVTest, line_draw) {
cv::Mat expected = cv::Mat::zeros(500, 500, CV_8UC3);
cv::line(expected, cv::Point(100, 100), cv::Point(400, 105),
cv::Scalar(0, 0, 200), 3, cv::LINE_4)... |
bcc066e0f332d5f89b16d4351d185c93792059e1 | 4bd652f5d685014a1f864e00897a64774f3ea2a7 | klecki/DALI | /dali/image/tiff.cc | C++ | cc | 2,971 | permissive | // Copyright (c) 2017-2018, NVIDIA CORPORATION. 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 requ... |
a2f4005e058ffa8daad39ea7758a796796449033 | 26bdee3bc08587ed49ad54b38728c1350d9769e0 | afluriach/ScarletDevilUnderground | /cocos2d/cocos/platform/win32/CCApplication-win32.cpp | C++ | cpp | 7,546 | no_license | /****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation file... |
cb5c1e20d1cbf497c43c7177fed2e32ffbe3d26f | 6ace9d63755a20096d0e9f4b8a089e25916e12cb | dongnamyoooooooooon/yoOoOoOon | /necrodancer/armor_glass.cpp | C++ | cpp | 505 | no_license | #include "stdafx.h"
#include "armor_glass.h"
armor_glass::armor_glass()
{
}
armor_glass::~armor_glass()
{
}
HRESULT armor_glass::init(string imgName, int idxX, int idxY, ITEM_TYPE type)
{
item::init(imgName, idxX, idxY, type);
_appliedValue = 999;
return S_OK;
}
void armor_glass::release()
{
}
void armor_gl... |
1e65a1e8f05e240e93fbb1e09aa89c1fe6334559 | 1e981050bcd9400eae8eb8a8d3a374d2d297a620 | LLNL/conduit | /src/tests/relay/t_relay_io_hdf5_ident_report.cpp | C++ | cpp | 3,646 | permissive | // Copyright (c) Lawrence Livermore National Security, LLC and other Conduit
// Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
// other details. No copyright assignment is required to contribute to Conduit.
//-----------------------------------------------------------------------------
///... |
2b819712fc6b1d617d3a461f7ec0615c555f6246 | 9dce5353b45eb4eb44a27cf10ca3b3ad2442f20f | a6blp/fits_head_read | /fitshead.cpp | C++ | cpp | 339 | no_license | #include<iostream>
#include<CCfits/CCfits>
//using namespace CCfits;
int main(int argc, char** argv){
const string filename = *(argv+1);
std::auto_ptr<CCfits::FITS> input_file(new CCfits::FITS(filename, CCfits::Read));
CCfits::PHDU& header = input_file->pHDU();
header.readAllKeys();
std::cout << header << std::e... |
a2c8b5fdf9554436ceac4f8adfa2ed5b995f2743 | e8376e0b962399031b551f006532c5d9900cd0f5 | stnava/ITK | /Modules/Numerics/NarrowBand/include/itkNarrowBand.hxx | C++ | hxx | 2,236 | 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... |
7defd66edda52a105f469b451c0a892279ca5274 | de6d4b66fafbcdf0ac4e64a8e9ce1cce7e9a524c | morphed/MoRPHED | /MoRPHED_LIB/morph_exception.cpp | C++ | cpp | 1,480 | no_license | /*
This file is part of MoRPHED
MoRPHED 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 License, or
(at your option) any later version.
MoRPHED is distributed in the hope that it will be ... |
8db333ef80032d1cb1ae615d1b5d5484c63bdec5 | 8250ce79b5771b9dca484cb074241e6fe22dcaa8 | skrll/gxemul | /gxemul/branches/gxemul-complete-c++-rewrite-attempt/src/ui/gtkmm/GXemulWindow.cc | C++ | cc | 17,605 | permissive | /*
* Copyright (C) 2007-2008 Anders Gavare. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list... |
b8faa75bc5c59a17216a2f3d9ea459102337e160 | 8e8244197bf09f94df4e7e2f745b5b7a187b9668 | minus9d/programming_contest_archive | /arc/149/b/b.cpp | C++ | cpp | 6,662 | no_license | #include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <... |
c997045a5655f1bc8623da249a0a37f8d094fa2e | ca1fff8fe74355b8738515ab1077686c2587f3e4 | SimKyuSung/Algorithm | /BeakJoon C++ Algorithm/15710.xor 게임.cpp | C++ | cpp | 1,038 | no_license | /// 15710.xor 게임
#include <iostream>
#define endl '\n'
using namespace std;
const int MOD = 1000000007;
size_t powermod(size_t, size_t, size_t);
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
size_t a, b, n;
cin >> a >> b >> n;
if (n == 0)
cout << (a == b) << endl;
else {
int c = powermod(2, n ... |
81c9a979cbfcedb0a8b55ac5e819d41a28872031 | 4fe929860f7527198b152433811b439f20a1722c | arata-avh/av.cash | /rpc/misc.cpp | C++ | cpp | 30,773 | no_license | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2017 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 <base58.h>
#include <chain.h>
#include <clientversion.h>
#include <core_io.h>... |
888484602e67b0a052227193579b21f61d523907 | e58c4beeb9b069fcc5ed1444f7036810d7f3f02c | ishansheth/GTestPoc | /test/testall_main.cpp | C++ | cpp | 233 | permissive | #include <limits.h>
#include "gtest/gtest.h"
#include <iostream>
int main(int argc, char **argv)
{
std::cout<<"**********Executing Tests***********"<<std::endl;
::testing::InitGoogleTest(&argc,argv);
return RUN_ALL_TESTS();
}
|
c6c6d36572bdd40ff1f57b6c5423f2cb1444d4a4 | 3ca599fe97f67df3bde0c2d8873a31b0e82bab87 | DanielToledo99/depo | /funcion8/main.cpp | C++ | cpp | 376 | no_license | #include <iostream>
using namespace std;
int func8(int a, int b){
cout << "Los valores son :" << endl;
cout << "x= " << a << endl;
cout << "y= " << b << endl;
int * c = &a;
int * d = &b ;
int e = *d;
int f= *c;
cout << "Los valores invertidos seran:" << endl;
cout << "x= " << e << endl;
cout << ... |
ea8bf463f1f5aaf9104bbf5c3313d15b4069df5e | 258a1c85a9ae167c5c9739ab6cef804ccb73bce6 | FeZar97/ArtOfDeveloping | /RedBelt/RedBelt510/synchronized.cpp | C++ | cpp | 3,226 | no_license | #include <numeric>
#include <vector>
#include <string>
#include <future>
#include <mutex>
#include <queue>
#include <thread>
#include "../test_runner.h"
using namespace std;
// Реализуйте шаблон Synchronized<T>.
// Метод GetAccess должен возвращать структуру, в которой есть поле T& value.
template <typename T>
class... |
6cc0cf77d73c413dbf64b89300f7d2c0d8aae315 | f72191bc04c3891ecfdba8dc25c37abe7231efe1 | mustafaemre06/tools | /src/OpenDIS/cpp/DIS/EntityStateUpdatePdu.cpp | C++ | cpp | 7,334 | permissive | #include <DIS/EntityStateUpdatePdu.h>
using namespace DIS;
EntityStateUpdatePdu::EntityStateUpdatePdu() : EntityInformationFamilyPdu(),
_entityID(),
_padding1(0),
_numberOfArticulationParameters(0),
_entityLinearVelocity(),
_entityLocation(),
_entityOrientation(),
_entityAppearance(0),
... |
c60fc7684eae16182b9b996c4d4353e62984787a | 0300df413cb0ae98cea14ba7c4f3393986b984f0 | setrapp/jetpack | /Jetpack Jetpack Party DX11/DirectX11_Starter/DemoGame.cpp | C++ | cpp | 34,162 | no_license | // ----------------------------------------------------------------------------
// A few notes on project settings
//
// - The project is set to use the UNICODE character set
// - This was changed in Project Properties > Config Properties > General > Character Set
// - This basically adds a "#define UNICODE" to... |
69984f235708279e43288fef11c5e094e5271340 | bb29d05170c57d7154dc2c418da6f8821ae40e5a | supermario1990/wigwag | /include/wigwag/detail/enabler.hpp | C++ | hpp | 925 | permissive | #ifndef WIGWAG_DETAIL_ENABLER_HPP
#define WIGWAG_DETAIL_ENABLER_HPP
// Copyright (c) 2016, Dmitry Koplyarov <koplyarov.da@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted,
// provided that the above copyright notice and this permiss... |
eb20e2552b36c06c561581aa0142cc38e8bf3077 | 2877883d5fa8f4456c7ba106006b9a5b449a88f0 | ohld/acroparallels2016 | /osamara/mapped_file/main.cpp | C++ | cpp | 410 | no_license | #include "mapped_file.h"
#include <stdio.h>
int main(){
//printf("1erwerwer\n");
mf_handle_t mf = mf_open("test");
//printf("2\n");
char buf[20 ] = "1111";
mf_write(mf, buf, 4, 3);
//printf("3\n");
mf_read(mf, buf, 10, 1);
//printf("4\n");
printf("%s\n %d\n", buf, (int)mf_file_size(mf));
//printf("%d\n", 40*... |
0f9bb24a03d5ca037ecfc5ca2d2ddc5df821f296 | 79c1a6604fd447b78edefdc426f89f82685b680b | Csineneo/Vivaldi | /chromium/gpu/ipc/service/webgpu_command_buffer_stub.cc | C++ | cc | 5,699 | permissive | // Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gpu/ipc/service/webgpu_command_buffer_stub.h"
#include <memory>
#include <utility>
#include "base/macros.h"
#include "base/memory/shared_m... |
1a52c5b61fd8490d19c47690d506b9a161d4ae59 | 8ce1bcdb01034a8511e1c88169a3d0292df9ad07 | realcapacitor/cpp_returns | /2user_input.cpp | C++ | cpp | 1,226 | no_license | #include<iostream>
using namespace std;
int main(){
string firstName;
string lastName;
int age;
float weight;
float heightInCM;
long phoneNumber;
char bloodGroup[5];
string email;
cout<<"Enter your first name \t:";
cin>>firstName;
cout<<"Enter your last name\t:";
cin>>la... |
ca29a51436d94efa4e466f90e274c3b546a8b8e0 | 2ae17289d86fff6eee5a27a6103be1e274784a93 | HuangStomach/Cpp-primer-plus | /17.IO&Files/17.11.check_it.cpp | C++ | cpp | 318 | permissive | #include <iostream>
int main(int argc, char const *argv[]) {
using namespace std;
cout << "Enter numbers: ";
int sum = 0;
int input;
while (cin >> input) {
sum += input;
}
cout << "Last value entered = " << input << endl;
cout << "Sum = " << sum << endl;
return 0;
}
|
be30dfd10b223cfface74dd9d6244e686b69b8a1 | c9a207f57d72834db64d532ff8d231eed2dc8e25 | Xilinx/Vitis_Libraries | /security/L1/tests/cfb/cfb8/aes192enc/test.cpp | C++ | cpp | 1,068 | 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... |
9a0a840e4343160d72b5ba959b0df877282d5b3f | 1dca060efa1e69d9fe83650f66f0856793e420cd | bigplayszn/xtd | /examples/xtd.forms.examples/components/countries/src/countries.cpp | C++ | cpp | 2,913 | permissive | #include <xtd/xtd>
using namespace std;
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace examples {
class main_form : public form {
public:
static void main() {
application::run(main_form());
}
main_form() {
text("Countries example");
client_s... |
4c21217036c95fd49ee1d689bb34a2972db647a3 | 6b310994eaf68954033218c66ca9361d9eb918a7 | jonathanpoelen/vt-kate-syntax-highlighter | /vthighlighter.cpp | C++ | cpp | 4,307 | permissive | /*
Copyright (C) 2018 Jonathan Poelen <jonathan.poelen@gmail.com>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any ... |
900fba3e8c91d34ee21696a3de6eef1c0a589d22 | 7ee66f2676f220d744845ffa7488555e6f33fd2e | ebriussenex/cplusplus-issue | /white_belt/everymonth.cpp | C++ | cpp | 3,193 | no_license | #define _CRT_SECURE_NO_WARNINGS
#define _CRT_DISABLE_PERFCRIT_LOCKS
#define pass (void)0
#include <limits>
#include <iostream>
#include <stack>
#include <queue>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <fstrea... |
97686050874ae3d48af9307cdae6a15dab62b35d | 05ef855de7e71fa9eb01992d55c55cb58601e688 | ddcc/llvm-project | /clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp | C++ | cpp | 6,205 | permissive | //===--- InefficientAlgorithmCheck.cpp - clang-tidy------------------------===//
//
// 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
//
//===---------------------------... |
19e1d75067063765ee15d5b044f59dcf9b32ab7a | 43b8177a1daf8313fadd930a49c0135740136cc3 | CU-0xff/juliet-cpp | /000/241/746/CWE762_Mismatched_Memory_Management_Routines__delete_array_char_calloc_82_bad.cpp | C++ | cpp | 1,172 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__delete_array_char_calloc_82_bad.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete_array.label.xml
Template File: sources-sinks-82_bad.tmpl.cpp
*/
/*
* @description
* CWE: 762 Mismatched Memory Man... |
bcf1323ecef0c653ab52dacf190afeb665b2a9a4 | 823b87856374bca90158722106ad70f8933311ab | zenotech/VTK | /IO/ADIOS2/VTX/schema/VTXSchema.cxx | C++ | cxx | 3,976 | permissive | /*=========================================================================
Program: Visualization Toolkit
Module: VTXSchema.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed ... |
41315177223cdfaa39ece0830d4ec9ce72f2d249 | a1882ab6654125161235cb81f043926b664b9513 | seem-sky/skia | /src/image/SkImageShader.cpp | C++ | cpp | 9,174 | permissive | /*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkBitmapProcShader.h"
#include "SkBitmapProvider.h"
#include "SkColorShader.h"
#include "SkColorTable.h"
#include "SkEmptyShader.h"
#include "SkImage_Base.h"
#includ... |
97900be54d87490710c3381334f399b515c53fd7 | d0273da691d5baef6a68330028af2579ff542a6d | muidea/magicMirror | /test/HTTPStatusTests.cpp | C++ | cpp | 1,740 | no_license | /******************************************************************
*
* uHTTP for C++
*
* Copyright (C) Satoshi Konno 2002
*
* This is licensed under BSD-style license, see file COPYING.
*
******************************************************************/
#include <map>
#include "HTTPStatusTests.h"
#include <HTTP.h>
... |
66f7b51b7ed540cac0c537810d8931895fcde047 | c3b59924f2e594d9f0dce96d6a96be02ad8a99e8 | bopopescu/QuicDep | /src/base/process/process_win.cc | C++ | cc | 6,424 | permissive | // Copyright (c) 2011 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/process/process.h"
#include "base/debug/activity_tracker.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#inc... |
cfae93611c36bae745f2330dbdee785544887583 | c6f20731871bfe8c1df45512809fa5fbae99a494 | snps-oss/compiler-rt | /lib/sanitizer_common/tests/sanitizer_deadlock_detector_test.cc | C++ | cc | 9,941 | permissive | //===-- sanitizer_deadlock_detector_test.cc -------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
8016cf77826e19c8dee857b43650a1f99c1a6bf7 | 3734578947864bbe04b9d5198c606b3c90619114 | thyagostall/competitive | /competitive_programming/chapter3_dynamic_programming_longest_increasing_subsequence/uva00481.cpp | C++ | cpp | 2,245 | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#define FIRST -1
using namespace std;
istream &operator>>(istream &in, vector<int> &v);
ostream &operator<<(ostream &out, vector<int> v);
vector<int> lis(vector<int> &sequence);
int get_correct_position(const vector<int> &elements, const int size, const int... |
87a88394e2e5019fce139acbdfd3ecc3eff83e41 | 75fbf6458d93b4a2969d2b1d63b55f853a6d82a8 | ParadoxGameConverters/Vic2ToHoI4 | /src/Mappers/CountryName/CountryNameMapperTests.cpp | C++ | cpp | 1,184 | permissive | #include "external/common_items/external/googletest/googletest/include/gtest/gtest.h"
#include "src/Mappers/CountryName/CountryNameMapperFactory.h"
#include <sstream>
TEST(Mappers_CountryName_CountryNameMapperTests, NonMatchReturnsNullopt)
{
const auto mapper = Mappers::CountryNameMapper::Factory().importCountryNam... |
f7da2b8467244fcded24ba584f5615ed66998adc | 164cb037275da01e395ec7f27bb08ad929517703 | mizbit/LA104 | /system/apps_ds213/55_gabosc/source/ToolBar.cpp | C++ | cpp | 6,766 | no_license | #include "Toolbar.h"
#include "MainWnd.h"
/*static*/ const CWndToolBar::CBarItem* CWndToolBar::GetMenuItems()
{
static const CBarItem arrMenuItems[] = {
{ CBarItem::IMain, (PSTR)"Oscilloscope", nullptr},
{ CBarItem::ISub, (PSTR)"Input", &MainWnd.m_wndMenuInput},
{ CBarItem::ISub, (PSTR)"Cursor", &Main... |
28add7ba24b2047fec37ccb7743ad3af209f6751 | 0e022c9dd9a2806a43cdc948510514c89b3da336 | rodrigorato/asa-afilliates-and-towns | /veccompare/pri_q.cpp | C++ | cpp | 1,008 | no_license | #include <iostream>
#include <stdio.h>
#include <queue>
#include <vector>
using namespace std;
class vec_compare{
const vector<int>* _somenumbers;
public:
vec_compare(const vector<int>* somenumbers){
_somenumbers = somenumbers;
}
bool operator() (const int& lhs, const int&rhs) const {
return (*_som... |
25dbb3b4af0b3b4498eb234fa629fdc69df07f26 | 3f5894e1bc39dd2217871bab2cc2240900af0076 | kitesoft/Roomer-PMS-1 | /Extras/DevExpress VCL/Library/RS17/dxPScxSchedulerLnkReg.hpp | C++ | hpp | 1,204 | no_license | // CodeGear C++Builder
// Copyright (c) 1995, 2012 by Embarcadero Technologies, Inc.
// All rights reserved
// (DO NOT EDIT: machine generated header) 'dxPScxSchedulerLnkReg.pas' rev: 24.00 (Win32)
#ifndef DxpscxschedulerlnkregHPP
#define DxpscxschedulerlnkregHPP
#pragma delphiheader begin
#pragma option push
#pragm... |
2bc61523954051f0618327f4d13dd61fc37c1f55 | 210024599923a15184cb63b4429ae90cac61c52d | dingjun/Nekoban | /Classes/InputComponent.cpp | C++ | cpp | 1,058 | permissive | #include "InputComponent.h"
#include "Level.h"
#include "MoveUnitCommand.h"
USING_NS_CC;
InputComponent::InputComponent()
{
}
InputComponent::~InputComponent()
{
}
void InputComponent::handleKeyboardInput(EventKeyboard::KeyCode keyCode, Unit* unit)
{
Level* level = unit->getLevel();
// ig... |
b6b2ecb6c13744c75437034fb9dd092f19ced608 | e4a71b9cc5a82c253a8ee784ebcde5d57dc9c2bc | chenhongqiao/USACO | /beads/beads.cpp | C++ | cpp | 1,075 | permissive | /*
ID: harrych3
TASK: beads
LANG: C++
*/
#include <iostream>
using namespace std;
char beads[400];
int ans = 0;
int main()
{
//decomment following lines when submit
//freopen("beads.in","r",stdin);
//freopen("beads.out","w",stdout);
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
cin ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.