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 |
|---|---|---|---|---|---|---|---|---|
8ff923e3aa14aca0882601ef9849594c9f94f6e8 | 39a068701108fbd4836f30c42785f5163c38d428 | aleafall/DS-A | /leetcode/lc0415.cpp | C++ | cpp | 879 | no_license | //
// Created by aleafall on 17-2-7.
//
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
class Solution {
public:
string addStrings(string num1, string num2) {
string ans;
reverse(num1.begin(), num1.end());
reverse(num2.begin(), num2.end());
int carry = 0;
for (int i = 0; i ... |
028bce477fe328127237938458dc1500912cddea | 1713f6c9170d5b9084fe67978d214d6b6ead89ac | catree/GOTURN_Training_Toolkit | /buildH5Datasets.cpp | C++ | cpp | 7,218 | no_license | #include "buildH5Dataset.h"
using namespace H5;
using namespace std;
using namespace cv;
using namespace caffe;
#define INPUT_SIZE 227
#define NUM_CHANNELS 3
void buildH5Datasets(string fileName, int samplesNum)
{
//Create HDF5 database file
hid_t fileID = H5Fcreate(fileName.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, H5P... |
0ac528f848c702bdaa63b76162cd536d1dae64b6 | 6585b3fcde0008b3e7bfadf8d73acc25375ecee5 | taiki-contact/atcoder | /ABC/173/b.cpp | C++ | cpp | 550 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll mod = 1e9+7;
#define rep(i,n) for(int i = 0;i<n;i++)
int main(){
int n;
cin >> n;
vector<string>s(n);
int ac = 0;
int wa = 0;
int tle = 0;
int re = 0;
rep(i,n){
cin >> s[i];
if(s[i] == "AC")ac++;
else if... |
68339922036b2075933e14aaf0259df46391b871 | 3ccf9ce2cefa021a31ec442e9a9b272f64335cac | ue4sdk/DRG-SDK | /DRG-SDK/SDK/DRG_UI_ImageTinted_structs.hpp | C++ | hpp | 368 | no_license | #pragma once
// Deep Rock Galactic (0.22) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "DRG_Basic.hpp"
#include "DRG_ENUM_MenuColors_classes.hpp"
#include "DRG_UMG_classes.hpp"
#include "DRG_Engine_classes.hpp"
#include "DRG_CoreUObject_classes.hpp"
#include "DRG_SlateCore_classes.hpp"
namespace SDK... |
f9883dfcc2bf1352a1df0197e7552acc488eb6d2 | c830df23c5e2079a513ed745a8adb41214bd5080 | davyw/opencv | /modules/core/src/alloc.cpp | C++ | cpp | 19,188 | no_license | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
9fa552aca22104b04acadfa83ac730c6d7921a1c | a39cb5c2def66a496008457d60c462f9b83083d1 | xsjames/upp-components | /Attic/Examples/SFtpMultiGetMT/SFtpMultiGetMT.cpp | C++ | cpp | 1,550 | permissive | #include <Core/Core.h>
#include <SSH/SSH.h>
using namespace Upp;
// This example demonstrates getting a directory listing, and using that list to download
// multiple files from the designated SFTP server asynchronously, using worker threads.
const char *dir = "/pub/example/";
const int MAXDOWNLOADS = 4;
... |
c391596b818a1b4f712ade40ea48616db4106b16 | 4a0944102f7c9874fbd8b6f3b36d623db64cce63 | jiayuanxu90/3D_DEAL | /3D_paper/mainwindow.cpp | C++ | cpp | 5,009 | no_license | #include "mainwindow.h"
#include <QApplication>
#include <QMenuBar>
#include <QGroupBox>
#include <QGridLayout>
#include <QHBoxLayout>
#include <QSlider>
#include <QLabel>
#include <QTimer>
#include <QKeyEvent>
#include <QMessageBox>
#include "glwidget.h"
MainWindow::MainWindow()
{
switch (QMessageBox::informa... |
33429405c94206039847fdfc96927d670477f131 | 0231b60250c1315a37f0d1cf78d2893ff0acca6e | OmarJaroudi/QT-Project-group-2 | /src/main.cpp | C++ | cpp | 322 | no_license | #include "welcomewidget.h" //this comment was added by merging branch Add-Game1 with master branch
#include <QApplication>
int main(int argc, char **argv)
{
QApplication app (argc, argv);
WelcomeWidget * scene = new WelcomeWidget();//initialize first widget displayed
scene->show();
return app.exec();
... |
c1c35b102506990127383f046c51d36529dfd217 | b5f90280d307f8b22e24e186034a2d9318ab9513 | metux/chromium-suckless | /chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc | C++ | cc | 6,640 | 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/extensions/api/permissions/permissions_api_helpers.h"
#include <stddef.h>
#include <memory>
#include "base/macros.h"
#incl... |
53041a993dbe876212600bdaeeb71f1f7557e2e4 | 49a9da98875b8b6cd36d1b4c85da6508960055a9 | mck182/500pxMobileDevChallenge | /useritem.cpp | C++ | cpp | 1,279 | no_license | /*
* Copyright 2016 (c) Martin Klapetek <mklapetek@kde.org>
*
* 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) version 3 or any later v... |
adc11c5eb2a90abd2519519ff57332a85b61a842 | fd6aa9a937d40966b94fb9c6bd725994bb7f1e70 | xiongjuncheng/llvm-project | /libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp | C++ | cpp | 816 | permissive | //===----------------------------------------------------------------------===//
//
// 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
//
//===---------------------------... |
4a9e53416fec4e26f94462374d3a7ae47fb61d1a | e330bdafae7c966916894f9f2927c96cfdcde7e4 | sanllier/QGen | /src/qindivid_gpu.cpp | C++ | cpp | 7,880 | no_license | #ifdef GPU
#include "qindivid_gpu.h"
#include "qgen.h"
#include "defs_gpu.h"
#include "curand.h"
#include "cuda_runtime.h"
#include "cuda_error_handler.h"
#include "mpicheck.h"
#include <time.h>
//------------------------------------------------------------
namespace QGen {
//-------------------------------------... |
737510c8d56cff8c8a9c0a4d423eaf91deede2c2 | ffc5b26ce2ae9fe2e1472f0ed2f960d956fa014b | Andrysky/anyrpc | /src/method.cpp | C++ | cpp | 6,596 | permissive | // Copyright (C) 2015 SRG Technology, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, pu... |
b87141ad6804eea62f442883164a6bef131f3669 | db46e1f65b9bca04ecc0d0627f4f643eb7164c3d | MichaelEBurton/PPP_Cpp | /Chapter9/Code/Chrono.cpp | C++ | cpp | 2,540 | no_license | //Chrono.cpp
#include "Chrono.h"
namespace Chrono {
// member function definitions:
Date::Date(int yy, Month mm, int dd)
:y{yy}, m{mm}, d{dd}
{
if(!is_date(yy,mm,dd)) throw Invalid{};
}
const Date& default_date()
{
static Date dd {2001, Month::jan, 1}; // start of 21st century
return dd;
}
Date::D... |
299b6260ec2d9987e8f030d2c7e12cc9b03639c6 | 55ce010eb8ef3da43076f8ed92a979f6896b6bad | kanumadai/Cplusplus | /DynShow/DynShowDlg.cpp | C++ | cpp | 126,524 | no_license | // DynShowDlg.cpp : implementation file
//
#include "stdafx.h"
#include "DynShow.h"
#include "DynShowDlg.h"
#include "Fast57600.h"
#include "ComSel.h"
#include "PeakVale.h"
#include "EnergeSpectEth.h"
#include "ProgContrl.h"
//#include "EZ_USBAPI.h"
#include "EzusbApi.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef T... |
0f4278eb3d18aa3559657720148c20447968109d | 9799ea1fc4f80f7414bf759b86cb93e4069f009d | Taylor-Fowler/TDF-Engine | /src/src/RenderResources/ShaderModule/SkyboxModule.cpp | C++ | cpp | 1,373 | no_license | #include "SkyboxModule.h"
#include "..\Program\Program.h"
#include "..\ShaderParameter\ShaderParamList.h"
#include "..\..\Engine\Components\Camera\Camera.h"
#include "..\Factory\RenderResourceFactory.h"
#include "..\Mesh\Mesh.h"
#include "GL\glew.h"
#include "glm\gtc\type_ptr.hpp"
SkyboxModule::SkyboxModule(std::shar... |
21117ef64aa9cfd2fb2c500254792e86c75ed2ec | 2bcb386f79764bf1cbae6dac26e7fa8897e21786 | mellertson/ARExplorer | /ARS DLL/ARS DLL.cpp | C++ | cpp | 1,613 | no_license | // ARS DLL.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include <afxdllx.h>
#include "Globals.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// Global variable for DLL logging
CFileLogging log;
static AFX_EXTENSION... |
a19f10859690a30d794dbd620490653ec026940a | 8884073d515d10d127d4dd26d5ea985e04a5413d | peersend/peersend_ | /src/test/scriptnum_tests.cpp | C++ | cpp | 7,201 | permissive | // Copyright (c) 2012-2014 The Bitcoin Core developers
// Copyright (c) 2017 The peersend developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "libzerocoin/bignum.h"
#include "script/script.h"
#include <boost/... |
7776a28d61a5d26923298a47f71c2a6339b82019 | 94abd632cfa9dee9477ef862a99a01b5f5326a68 | cenariusxz/ACM-Coding | /socode/算法A/C9/189.cpp | C++ | cpp | 998 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
const int mod = 1e9 + 7;
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const int maxn = 1e6 + 5;
const int maxm = 1e6 + 5;
int a[maxn];
void qsort(int l,int r){
if(l >= r)return;
int i = l, j = r, pi... |
845ab7029528ea033acd72e310e3521a34ef2f23 | 5dd6121227d35bff48d8958aa347b8a60a4f4935 | katarzynawozna/Cpp2020 | /Lista6/zadanie1/main.cpp | C++ | cpp | 824 | no_license | #include "stos.h"
void Stos::_grow()
{
assert(_size == _capacity);
_capacity *= 2;
int* p = new int[_capacity];
for (size_t i = 0; i < _size; i++)
p[i] = _tab[i];
delete[] _tab;
_tab = p;
}
void Stos::_shrink()
{
assert(_capacity >= 4);
_capacity /= 2;
int* p = new int[_capacity];
for (size_t i = 0; i < _... |
37df2e3a31d13908aa50b35c01ffeaad5342c9ea | fb64972f0c18b918b286cff04d446f0aa110aa1a | trainer2/AUDIO-DSP- | /Envelopes.cpp | C++ | cpp | 4,999 | no_license | #include "Interpoladoras.cpp"
#include "funciones.h"
//Sigue la onda trackeando los maximos locales y creando un breakpoint por cada uno de ellos
//va por copia porque lo estoy modificando
//TODO: Que rastree bien los silencios y los momentos distorsionados. No lo esta haciendo de esta manera
vector<breakpoin... |
9c3cef80aeee8512a2ea3c9b4be9ff6844e38af5 | 996039610ed3578642531faa2d0452c7c5f9460d | TuojianLYU/forte_IO_OPCUA_Integration | /src_change_the_layout/modules/convert/DINT2DINT.cpp | C++ | cpp | 1,999 | no_license | /*******************************************************************************
* Copyright (c) 2006 - 2013 Profactor GmbH, ACIN
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* S... |
7c90dad55ffeeb1290ab4c3244f617dd737026eb | 3372a95e7fbf96c52a4e4643c94dcdedcedbd556 | litao1009/SimpleRoom | /externals/OCCTLib/inc/RWStepFEA_RWConstantSurface3dElementCoordinateSystem.hxx | C++ | hxx | 2,278 | 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 _RWStepFEA_RWConstantSurface3dElementCoordi... |
63f21bfb89702bca1356a61007073997182fe909 | 5e7bb17000ff14a2fbfd2cf123423a9151ed887f | noscripter/cefode-chromium | /chrome/browser/policy/user_cloud_policy_manager_unittest.cc | C++ | cc | 2,676 | 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/policy/user_cloud_policy_manager.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_... |
1b40b2c0fec5a9494a776c768fffd60b17459a07 | cbc863257eff63e8434789fe3c191d980e61ae95 | woosuk-choi-g/CHI-PPO | /baekjoon/13460_구슬탈출/13460_sungyil.cpp | C++ | cpp | 1,860 | no_license | #include <iostream>
#include <cstring>
#include <queue>
using namespace std;
void bfs();
struct Node{
int rx,ry,bx,by;
};
int n, m;
char bmap[11][11];
pair<int, int> spoted[3];
int moveY[4] = { -1,1,0,0 };
int moveX[4] = { 0,0,-1,1 };
int cheking[11][11][11][11];
bool tcheck = true;
int ans = -1;
int main() {
cin >... |
c464ff6f0971d734005e5d6d7c1b6b62cd685a84 | d0ba3f5ffd8ed9ecf318ce613ff5e295b9bd097c | NAMYUNWOO/ProblemSolving | /N10815.cpp | C++ | cpp | 839 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int isInCard(int,int *,int,int);
int main(){
int n ;
scanf("%d",&n);
int *myCard = (int *)malloc(sizeof(int)*n);
for(int i = 0;i<n;i++)
scanf("%d",&myCard[i]);
int k;
scanf("%d",&k);
int *card = (int *)m... |
e11703a38d0326057edee08c184b15953f1620be | d13d7039f9d783ab4999c1daf4c653d8cdb7d369 | LorenzE/mne-cpp | /libraries/disp/viewers/helpers/channelinfomodel.cpp | C++ | cpp | 23,857 | permissive | //=============================================================================================================
/**
* @file channelinfomodel.cpp
* @author Lorenz Esch <lesch@mgh.harvard.edu>;
* Christoph Dinh <chdinh@nmr.mgh.harvard.edu>
* @since 0.1.0
* @date November, 2014
*
* @section ... |
b7233827871ca29e8ce756a8598802c7b60f5124 | 1a4c3dfe049d480e70988ba80b16cda42202f657 | webosose/chromium79 | /src/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc | C++ | cc | 15,624 | permissive | // Copyright (c) 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 "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h"
#include <limits>
#include <utility>
#include <vector>
#includ... |
702b106be45683d8c83960ecad1be8ead29d9272 | 96eedb710a0b7dc16adcd557c7a40e7561f5554e | maker91/DromaiusGB | /DromaiusGB/lcd.hpp | C++ | hpp | 3,030 | no_license | #pragma once
#include <SFML/Graphics.hpp>
#include "types.hpp"
#include "addressable.hpp"
#include "interrupts.hpp"
namespace dromaiusgb
{
union lcd_control_t
{
byte value;
struct
{
byte bg_display : 1;
byte obj_display_enable : 1;
byte obj_size : 1;
byte bg_tile_map_display... |
1b5140ba04405509439c16216adabba9ca7978ae | 050a07d13a17f622f6bfc2d0225e1856e59c8fb9 | Binamra7/LabAssignment | /testFile/codewars.cpp | C++ | cpp | 1,125 | no_license | #include<iostream>
#include<vector>
#include<string>
#include<bits/stdc++.h>
#include<cmath>
#include<cstring>
#include<map>
#define ll long long
using namespace std;
std::string range_extraction(std::vector<int> args) {
int c=0;
vector<string> a,b;
for(int i=0;i<args.size();i++){
int z=i;
... |
d2434f5f8f0cf9c28ae84075aa4a03dfd479475a | 6530786f542104859985fe86a5d961ba3724b570 | pierrepas/TP2_C- | /Histogramme.hpp | C++ | hpp | 1,388 | no_license |
#include <vector>
#include "Image2D.hpp"
class Histogramme{
typedef Image2D<unsigned char> GrayImage;
std::vector<float> h1;
std::vector<float> hC1;
public:
template <typename InputIterator>
void init(InputIterator it, InputIterator itE){
float valeur = 0.0;
for (; it != itE; ++it){
... |
437bc16750701037f79efb1329052b06763ddbac | 521e4243fb05073242b0cdb1db9274ae54ceac45 | Cyprella/GreenPayCoin | /src/qt/blockexplorer.cpp | C++ | cpp | 19,549 | permissive | #include "blockexplorer.h"
#include "bitcoinunits.h"
#include "../chainparams.h"
#include "clientmodel.h"
#include "../core_io.h"
#include "guiutil.h"
#include "../main.h"
#include "../net.h"
#include "../txdb.h"
#include "ui_blockexplorer.h"
#include "ui_interface.h"
#include "../util.h"
#include "../utilstrencodings.... |
244e0928cf8a4ec1aee5071b0f62e995485593db | ab415169f024c504a7841af85ec94d095c30951c | Samnuge/CS-404-Emergency-Vehicles | /Project1/Project1/Source.cpp | C++ | cpp | 4,672 | no_license | #include<iostream>
#include<queue>
#include<array>
#include<fstream>
#include<cstdlib>
using namespace std;
// -- emergency data arrays -- //
int Emerg_ID[500];
int Emerg_type[500];
int Emerg_zip[500];
// -- person in emergency data arrays -- //
int Person_ID[500];
int Person_type[500];
int Person_zi... |
930fd252bab7d8802840f4e2af360a3b51905124 | 80e5a30b0a2e3b772735f8d9b7c98c40f66c6ea8 | iqqg/generate-ninja | /tools/gn/inherited_libraries.cc | C++ | cc | 3,008 | permissive | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "tools/gn/inherited_libraries.h"
#include "base/containers/adapters.h"
#include "tools/gn/target.h"
InheritedLibraries::InheritedLibraries() {
... |
eb9331112a7f60461d2dc4ce42425f74b505a9a3 | cb3d98a104eec3a96b9c350528de027ee715c79e | nViso/Caffe-mini | /caffe/softmax_loss_layer.cpp | C++ | cpp | 1,889 | no_license | // Copyright 2013 Yangqing Jia
#include <algorithm>
#include <cfloat>
#include <vector>
#include "layer.hpp"
#include "vision_layers.hpp"
#include "math_functions.hpp"
using std::max;
namespace caffe {
template <typename Dtype>
void SoftmaxWithLossLayer<Dtype>::SetUp(const vector<Blob<Dtype>*>& bottom,
vecto... |
027fda2e6c8a4ecf788ab12ebb6188ad46ef0c8c | 46a0d695234e961e6f4fb91a2cc2ab626eb1cc3f | cha63506/chromium-44 | /chrome/browser/sync/sync_setup_wizard_unittest.cc | C++ | cc | 20,039 | permissive | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/sync/sync_setup_wizard.h"
#include "base/json/json_writer.h"
#include "base/scoped_ptr.h"
#include "base/stl_util-inl.h"
#in... |
fdaf34de9843be21e7404e54bfc3508587a81371 | e057ae7a8f26420ca04b8da91d929937e750ec47 | R4x7651/PAT_Answers | /PAT_LevelA/1027_Colors_in_Mars.cpp | C++ | cpp | 320 | permissive | #include "cstdio"
char s[13] = {'0','1','2','3','4','5','6','7','8','9','A','B','C'};
int main() {
int rgb[3];
if (scanf("%d %d %d",&rgb[0],&rgb[1],&rgb[2])==1);
printf("#");
for (int i = 0; i < 3; ++i) {
printf("%c",s[rgb[i] / 13]);
printf("%c",s[rgb[i] % 13]);
}
return 0;
} |
52f6a2b9c007ff1d64119267dc7e93fdd5a3e2f1 | 5a32a30f459fb1fb8a81584b8b500710ebf38d02 | hackerlank/code-2 | /Projects/Logic/Client/Src/CAIEntityHateDetect.cpp | C++ | cpp | 5,473 | no_license | /******************************************************************************/
#include "stdafx.h"
#include "CAIController.h"
#include "CAIEntityHateDetect.h"
#include "ICollisionSystem.h"
#include "CCharacterSceneEntity.h"
#include "ClientMain.h"
#include "CSceneManager.h"
#include "CTroopSoldierEntity.h"
#include "... |
65afece49abf126bd00b0621bdfbaf417c8ff06a | 7ccb621d8340dd722f3c168a11bd94466e18b456 | aws/aws-sdk-cpp | /generated/src/aws-cpp-sdk-networkmanager/source/model/CreateConnectAttachmentResult.cpp | C++ | cpp | 1,316 | permissive | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/networkmanager/model/CreateConnectAttachmentResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>... |
8b584155584662cd03bade42da022e26b33dae49 | 125ac4d5c27f50d1e9e15fc2cffcaebf74109b7c | kkapuria3/regtools | /src/cis-splice-effects/cis_splice_effects_main.cc | C++ | cc | 2,490 | permissive | /* cis_splice_effects_main.cc -- handle the 'cis-splice-effects' commands
Copyright (c) 2015, The Griffith Lab
Author: Avinash Ramu <aramu@genome.wustl.edu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to d... |
f6c05fa9327a5430bf035254c44150c0a4004678 | da6816409ac3db6ae79ce7f9a7eb7011d1432a65 | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE126_Buffer_Overread/s02/CWE126_Buffer_Overread__malloc_char_memmove_43.cpp | C++ | cpp | 3,087 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE126_Buffer_Overread__malloc_char_memmove_43.cpp
Label Definition File: CWE126_Buffer_Overread__malloc.label.xml
Template File: sources-sink-43.tmpl.cpp
*/
/*
* @description
* CWE: 126 Buffer Over-read
* BadSource: Use a small buffer
* GoodSource: Use a larg... |
1733537237aa06c88e056ef22e36f0cea5e41717 | 9388cd9e877deceee6ff3aa55015d7ed9b5d654b | lukeronger/NuclearData-LZU | /NuclearData/NuclearData.cpp | C++ | cpp | 9,254 | no_license | #include<vector>
#include<iostream>
#include<fstream>
using namespace std;
#include"NuclearData.h"
NuclearData::NuclearData()
{
int Z, N, A;
double bcal, bth, stotal, bexp, sn, sp, s2n, s2p, qalpha, qbetam, qbetap, qbetaec, deltan, deltap;
vector<int>* vectorValidity = new vector<int>(45000);
vector<double>* vect... |
870fa7f370b3d68de81b380ec26b5c0e8c455b5d | 3b7adc9239644720f1741a4af791f8b68c02b1c5 | joanmaller/UPC-FIB | /PRO1/P2/P2_C202D/P27341.cc | C++ | cc | 277 | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int main() {
int a, b;
while(cin >> a >> b) {
int total = 0;
for(int i = a; i <= b; ++i) total += i*i*i;
printf("suma dels cubs entre %d i %d: %d\n", a, b, total);
}
} |
9f027d346c7393e4d8d6063dda6119560c2d2823 | 73492e673825442fcff002951e1c33504d8ddc7b | jaimeleonh/cmssw | /Alignment/SurveyAnalysis/plugins/SurveyDataConverter.cc | C++ | cc | 9,712 | permissive |
// Framework
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "Alignment/CommonAlignment/interface/AlignableModifier.h"
#include "Alignment/TrackerAlignment/interface/TrackerAlignment.h"
#include "Al... |
9d53fc29e582f0f4e48a005b59aad0402ce8447a | de923ae3a88ef61e31f67887f07d04160d7c650d | liuyihao18/QtBigHomework | /launcher.cpp | C++ | cpp | 306 | no_license | #include "launcher.h"
Launcher::Launcher(int launchInteval) : _launchInteval(launchInteval), _launched(
false)
{}
bool Launcher::canLaunch() const
{
return !_launched;
}
void Launcher::launch()
{
_launched = true;
}
void Launcher::ready()
{
_launched = false;
}
|
258ad6300318c7704ed58fd485e10120abf7453f | 493825d1ad256a319e25c56df7c9e93e91d0b51c | FranciscoThiesen/OldProblems | /Codeforces/round427/a.cpp | C++ | cpp | 741 | no_license | /*input
4 5 3 1 5
*/
#include <bits/stdc++.h>
using namespace std;
#define fr(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rp(i,n) fr(i,0,n)
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define mt make_tuple
#define mp make_pair
#define sz(a) (int)(a.size())
ty... |
81e1ed7c52fe189195772f460ebbe551443ba4ae | 537d287612fd8b3709960f0b7c5a4392b1dcac79 | E4S-Project/testsuite | /validation_tests/trilinos-legacy/SelfSmoother/cxx_main.cpp | C++ | cpp | 6,558 | permissive | /* ******************************************************************** */
/* See the file COPYRIGHT for a complete copyright notice, contact */
/* person and disclaimer. */
/* ******************************************************************** */
#include "m... |
cdab42df2ae68083c64ad6fbb7069e469be9e86d | 349002d5f441c088d16868c955f68b4d3e9873c2 | Mon-ius/ITK | /Modules/IO/CSV/include/itkCSVArray2DDataObject.hxx | C++ | hxx | 8,244 | permissive | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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.or... |
235520a75511be9b3bef93624ab1993b2d3b7108 | c76d020e53c69a39985f720a3040d852185007c2 | WhoisBsa/Faculdade | /7º Periodo Computacao/Processamento de Imagens/programas/aula01/helloworld.cpp | C++ | cpp | 1,367 | no_license | #include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
int main( int argc, char** argv ) {
Mat imagem, imagem_gray;
// VideoCapture CvCapture("sample.mp4");
// if (!CvCapture.isOpened())
// throw "Erro ao ler o arquivo de vídeo";
// namedWindow("Vídeo", WINDOW_NORMAL);
// resizeWindow... |
0d2bd50408825d8d99fb27502b80c784fd17babc | 03b8fa689d0ed6e8b9979209c1f6c2c529584289 | paolococchi/kv_engine | /cbsasl/plain/plain.cc | C++ | cc | 4,164 | permissive | /*
* Copyright 2018 Couchbase, 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... |
3bd1a0779b374641952949bf2857374e379b8406 | 266d946aa2b8fce98002ca6df82726f15588ad73 | xluos/ACM | /紫书/第4章/xiangqi/main.cpp | C++ | cpp | 3,736 | no_license | #include <bits/stdc++.h>
using namespace std;
struct node{
char ID;
int x,y;
};
int dir[][2]={-1,2,1,2,-2,1,-2,-1,-1,-2,1,-2,2,1,2,-1};
int dir2[][2]={0,1,0,1,-1,0,-1,0,0,-1,0,-1,1,0,1,0};
int qipan[11][10];
void GRlu(node qizi)
{
int x=qizi.x,y=qizi.y;
for(int i=x+1;i<11;i++)
if(... |
78ee36e294de9648ac4e8c8ffa1fa939d4843e44 | 90a715dfb5abc330c1f74b858ac51e038c2242ad | elune100/qt-fft-realtime-spectrum | /app/engine.cpp | C++ | cpp | 26,432 | no_license | /****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of th... |
4d88be479137eb53ed90fde4495d566ec7c92573 | 8a45247a9e6233a3408791d2fc6c96481de42fa0 | diwadd/sport | /cf_even_odd_game.cpp | C++ | cpp | 1,833 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
void left_just(string &s, int n, char c = ' ') {
while(s.length() < n) {
s = c + s;
}
}
template<typename T> void print_vector(vector<T> &vec) {
int n = vec.size... |
1a86309ed8866252746598274f3fd4d2e6727136 | 3ca3572608c0ae9e765c239e03752b3af92009a8 | Kevin-Richael/StudyELF | /StudyELF/StudyELFDlg.cpp | C++ | cpp | 1,861 | no_license |
// StudyELFDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "StudyELF.h"
#include "StudyELFDlg.h"
#include "afxdialogex.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CStudyELFDlg 对话框
CStudyELFDlg::CStudyELFDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(CStudyELFDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(... |
8e456ca8648972a0efc62c86bab65f20da9051e0 | 680a0a28972d0316b00478326db490481ef781c8 | sstokic-tgm/CSGOSimple | /CSGOSimple/SourceEngine/Vector4D.cpp | C++ | cpp | 8,433 | no_license | #include "Vector4D.hpp"
#include <cmath>
#include <limits>
namespace SourceEngine
{
void VectorCopy(const Vector4D& src, Vector4D& dst)
{
dst.x = src.x;
dst.y = src.y;
dst.z = src.z;
dst.w = src.w;
}
void VectorLerp(const Vector4D& src1, const Vector4D& src2, vec_t t, ... |
7ebc0486b3ba15a56ed4b2646add4010b41e56da | 2cea4f41bab3ae4b19567ccf44b991bf25cced93 | hkenzo/InfoBuraco_G1 | /Project1/saida.cpp | C++ | cpp | 258 | no_license | #include "saida.h"
saida::saida(string data, int numOS) {
this->data = data;
this->numOS = numOS;
}
int saida::getNumOS() {
return this->numOS;
}
string saida::getData() {
return this->data;
}
saida::~saida()
{
//TODO Auto-generated method stub
}
|
a20adbefdf0442ee2a4ef79747671a6e6bb0288c | 3aa0040ed038027e89633f1a5beb136300fa3c14 | wzyy2/chromium-browser | /third_party/WebKit/Source/core/paint/BlockPaintInvalidator.cpp | C++ | cpp | 1,152 | 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 "core/paint/BlockPaintInvalidator.h"
#include "core/editing/DragCaret.h"
#include "core/editing/FrameSelection.h"
#include "core/frame/LocalFram... |
4c9ac87399ea0139a88a46645246cd9eaf456dc9 | 61a10b80fc9389f729ea99abf7c506d3b80feade | mvanswol/WarGameWithCudaAI | /playerAI.hpp | C++ | hpp | 448 | no_license | //
// playerAI.hpp
// WarGameWithCudaAI
//
#ifndef playerAI_hpp
#define playerAI_hpp
#include <iostream>
#include "common.h"
#include "board.hpp"
#include "move.hpp"
#include "gameTree.hpp"
using namespace std;
class PlayerAI {
public:
PlayerAI(Side player, Board * b);
~PlayerAI();
Move *doMo... |
0536be8c14a8044ca0b8880e35afd335189e3d2f | 54a45fddc588713737bfd272a268e94840960944 | jhauswald/djinn | /tonic-suite/asr/src/gmmbin/gmm-global-acc-stats.cc | C++ | cc | 6,182 | permissive | // gmmbin/gmm-global-acc-stats.cc
// Copyright 2009-2011 Microsoft Corporation; Saarland University
// See ../../COPYING for clarification regarding multiple 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 o... |
41271fc20a82be683ea12a611f3925b1afbd91e8 | b0ac0dc4258d505c26eeeddd2598976ec4370cdb | mustafaelghrib/DesignPatterns | /C++/Observer/WeatherRama/subject/WeatherStation.cpp | C++ | cpp | 907 | no_license | #include "Subject.h"
#include <vector>
using namespace std;
class WeatherStation : public Subject {
public:
void registerObserver(Observer *newObserver) override {
observers.push_back(newObserver);
}
void removeObserver(Observer *removeObserver) override {
observers.erase(
... |
722a193ff918b146b2456baf8e31d6a4f3463028 | 1b59cc8acd509e6202f3f8e09814a9565f8c4015 | badda71/uae3DSng | /src/m68k/m68k_cmn_intrf.cpp | C++ | cpp | 5,554 | no_license | #define NO_SHORT_EVENTS
#define PROTECT_INFINITE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sysconfig.h"
#include "sysdeps.h"
#include "config.h"
#include "debug_uae4all.h"
#include "uae.h"
#include "options.h"
#include "memory-uae.h"
#include "custom.h"
#include "autoconf.h"
#include "ersat... |
f15165e5465643614ea43ace21a355bd08f2489d | 7c2561db07338a9e5dfac47c625ac28c3b8b1a7d | HaelC/LeetCode | /C++/79. Word Search/sol0.cpp | C++ | cpp | 1,250 | no_license | class Solution {
private:
bool exist(vector<vector<char>>& board, string word, int index, int i, int j, vector<vector<bool>>& visited) {
if (index == word.length()) {
return true;
}
if (i < 0 || j < 0 || i >= board.size() || j >= board[0].size()) {
return false;
... |
971fd8dbf533d22676d1d028542fdb4b0cd42ea8 | 65bf68f141ae336465618a960af71fb1e32a383b | jacky860226/A-k-way-Greedy-Graph-Partitioning-for-Parallel-Applications | /test/test.cpp | C++ | cpp | 472 | no_license | #include "../src/KGGGP.h"
#include <cstdio>
KGGGP Partitioner;
int main(){
freopen("test_input.in","r",stdin);
int n, m; // # of Vertex ,# of Edge
scanf("%d%d", &n, &m);
Partitioner.init(n,4); // 4-ways Partition
while(m--){
int u,v;
scanf("%d%d", &u, &v);
Partitioner.add_edge(u-1, v-1);
}
Partitioner.... |
adc3c3a275db779ab0fe5553ff6562406500b267 | a1d0283d25b64a4f816360b16463375dd9cd81db | imraghava/emojicode | /EmojicodeReal-TimeEngine/List.cpp | C++ | cpp | 7,204 | permissive | //
// List.c
// Emojicode
//
// Created by Theo Weidmann on 18.01.15.
// Copyright (c) 2015 Theo Weidmann. All rights reserved.
//
#include "List.h"
#include "String.h"
#include "Thread.hpp"
#include "standard.h"
#include <cstring>
#include <algorithm>
#include <utility>
namespace Emojicode {
void expandListSize... |
a94ffc9afffae1cc45e5f58d7dda24aee74fac85 | ae8adeaf81b135547e145ada6c6c2fb1d07bdf3b | ashok2811/CP_OLD | /LeetCode/Symmetric_Tree_Iterative.cpp | C++ | cpp | 1,170 | no_license | // Symmetric Tree -> Leetcode
// Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
// For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
*... |
0347c4f8a4dbdaf8fced105fd7ce093599c56e60 | 36b87ada6f7463861018b41704592e65ea911c5b | kmjp/procon | /2017-2021/2021/tenkei/002.cpp | C++ | cpp | 1,156 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))... |
f9a8e7acbe3ea36e5e1b2a7b494003ea1a135d1e | 00efe4b119827774b76d6926a7ab48bdeab7a7ea | dahahua/pap_wclinet | /client/Client/WXClient/Network/PacketHandler/CGItemSynchHandler.cpp | C++ | cpp | 272 | no_license | /*
同步客户端物品变化
*/
#include "stdafx.h"
#include "CGItemSynch.h"
UINT CGItemSynchHandler::Execute( CGItemSynch* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
return PACKET_EXE_CONTINUE ;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR ;
}
|
2018c6cfc72843982b3eb71e637262a491824a99 | b109f7a569f182f0ab3d233ffd362bfd996d2110 | bharathkarthikeyan/gecode | /gecode/int/gcc/bnd.hpp | C++ | hpp | 25,954 | permissive | /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Patrick Pekczynski <pekczynski@ps.uni-sb.de>
*
* Contributing authors:
* Christian Schulte <schulte@gecode.org>
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Patrick Pekczynski, 2004/2005
* Christia... |
366f65c96c75afb04bb335286b3e1b226c69ca87 | 7644c082b06e65742fcd5367be917b289938e577 | johnnyodonnell/cpp-data-structures-and-algorithms | /mergesort.cpp | C++ | cpp | 1,584 | no_license | #include <iostream>
#include <vector>
/*
* This currently uses O(nlog(n)) space, when we could instead use
* O(n) space
*
*/
using namespace std;
void mergesort(vector<int>& vec, int start, int end) {
if (start >= end) {
return;
}
int mid = start + ((end - start) / 2);
vector<int> left ... |
72388b3c7ea3ad539c2ae5020f2e98d10bc662c3 | 7ee4e753a08683f13487ff37e8dbf6e77ee978be | BlenderCN-Org/spacegameengine | /libs/fontbitmap/impl/include/sge/font/bitmap/impl/line_vector.hpp | C++ | hpp | 1,263 | no_license | /*
spacegameengine is a portable easy to use game engine written in C++.
Copyright (C) 2006-2016 Carl Philipp Reh (carlphilippreh <at> gmail.com)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation... |
c9c3826b6a8dc938335d84380b8f5907049a2ee1 | 20e11c9b98327442904ff701d03e67bfedefa2c2 | outadoc/KickHim | /server/networkhandler.cpp | C++ | cpp | 1,379 | no_license | #include "networkhandler.h"
#include <iostream>
using namespace std;
NetworkHandler::NetworkHandler(QObject* parent): QObject(parent)
{
connect(&server, SIGNAL(newConnection()), this, SLOT(acceptConnection()));
server.listen(QHostAddress::Any, 13374);
}
NetworkHandler::~NetworkHandler()
{
server.close();... |
65da2d98ad125296f31319c2ad0151859bb21afb | 522e3264a5cb8c6bf1a628d99154bba38bb078db | NBoetkjaer/ROBINsect | /raspPi/src/modules/CommandLineModule.hpp | C++ | hpp | 854 | no_license | #pragma once
#include "Module.hpp"
//#include <array>
//#include <string>
class CommandLineModule : public Module, public NodeObserver
{
private:
StringNode* pNodeCommand;
StringNode* pNodeOutput;
public:
CommandLineModule(){};
virtual ~CommandLineModule(){};
virtual void Publish() override;
v... |
784d07cfc1824d6fee693265ac6c096f4f3fb0b3 | b7e6a656778c83d401a280cfc14e26c5427ade38 | agileluo/c--_learn | /chapter7/7.9.stringFun.cpp | C++ | cpp | 499 | no_license | #include <iostream>
int c_in_str(const char * str, char c);
int main()
{
using namespace std;
char str1[] = "I come form china! ooo!";
char str2[] = "uubox, I know you!";
char c1 = 'o';
char c2 = 'u';
cout << c_in_str(str1, c1) << " " << c1 << " in " << str1 << endl;
cout << c_in_str(str2, c2) << " " <<... |
b353ea702f5d4f92d0823f92d539243b63d25ffb | 248b915189b35aebfd591ed22131c66ced538f92 | Saulovsky/ComputacionGrafica | /src/HelloTriangle.cpp | C++ | cpp | 1,832 | no_license |
#include <string>
#include <vector>
#include <stdio.h>
#include <iostream>
#include "GL/glew.h"
#include "GLFW/glfw3.h"
#include "Application.h"
Application app;
//Se tiene que llamar despues de inicializar la ventana y el OpenGL, pero antes del main loop
void setup()
{
app.setup();
}
//Se ejecuta siempre que se ... |
dcf0ea2ecf1f16cf17ac13efe3b9cd4e3acbb5f4 | d1db0a895ed419a8e9a6cefec22223d4e4089c5e | MartinClementson/SharedMem3DRenderer | /SharedMem3DRenderer/MayaCommunicator.cpp | C++ | cpp | 6,958 | no_license | #include "stdafx.h"
#include "MayaCommunicator.h"
bool MayaCommunicator::Execute()
{
while (running)
{
size_t length;
if(this->circleBuffer.Pop(msg, length) == true) // if a message has been recieved
msgHandler.TranslateMessage(msg, length);
}
return true;
}
MayaCommunicator::MayaCommunicator()
... |
c46effda281b1786e10e43d2781397a00516cafc | a9d47f9f44332dc408f120e8cb17fa16cf2629b2 | keenan-burnett/apollo | /modules/common/util/thread_pool.cc | C++ | cc | 1,306 | permissive | /******************************************************************************
* Copyright 2018 The Apollo 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
... |
b662e7d076fb6384d31642abf836bc9637a7f6a3 | f5cb5c189512fbdf8668aae962220c1d513d0355 | JohanMabille/boost.simd | /bench/function/simd/is_gtz/regular.uint8_t.0_10.cpp | C++ | cpp | 831 | permissive | // -------------------------------------------------------------------------------------------------
// Copyright 2017 - NumScale SAS
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at
// ... |
a827d1fa9278e4c704ff1d7829ce53b1cf0a629a | 86ed0001dd07ccc9de7fb51f20001d94d1ad1c02 | rrrfffrrr/godot | /scene/resources/primitive_meshes.cpp | C++ | cpp | 114,816 | permissive | /**************************************************************************/
/* primitive_meshes.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... |
0cd09ce128f66216df8ba237b503eb4a3359a6b3 | 9761808f89986ce9b8a2f96ac5af679796a5a26d | lnikon/max_subarray_compare | /brute_force.cpp | C++ | cpp | 1,870 | no_license | #include <vector>
#include <iostream>
#include <tuple>
#include <cstdint>
#include <limits>
#include <fstream>
#include <algorithm>
#include <iterator>
#include <chrono>
using ValueType = int64_t;
using IndexType = uint64_t;
using MaxTuple = std::tuple<IndexType, IndexType, ValueType>;
MaxTuple bruteForceMaxSubArray... |
10b0656f2a4508b0a77fd4f60d245f9575117a85 | a0c96817267673a019432d5602c3bdc837fe4058 | YashHiran/cses-ProblemSet | /Sorting and Searching/Stick Lengths.cpp | C++ | cpp | 382 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
long n; cin >> n;
long ans = 0;
vector<long> a(n);
for (int i = 0; i < n; ++i) cin >> a[i];
sort(a.begin(), a.end());
long val = a[n / 2];
for (auto x :... |
7c7a85b9c6f6c0986b47b231632282bb7999134a | 272a205394fb915311991ff46159bd10e695827d | MedoN11/CompetitiveProgramming | /CSAcademy/CSA40-D.cpp | C++ | cpp | 1,667 | no_license | #include <iostream>
#include <cstdio>
#include<list>
#include<iomanip>
#include<cmath>
#include<queue>
#include <functional>
#include<stdio.h>
#include<assert.h>
#include<stack>
#include<sstream>
#include <cstdlib>
#include<map>
#include<algorithm>
#include<iostream>
#include<set>
#include<utility>
#include<memory.h>
#... |
3495cb56d0633293deac49a011b277de7dd4a6c7 | 356ab04fac66cad6ffcfcfed4bcaeaf6bde77dfa | Bigo-Kang/PKNU | /Algorithm/C/DynamicProgramming/Prob1-1a.cpp | C++ | cpp | 1,246 | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 100
int m[MAX][MAX];
int p[MAX];
int min_k[MAX][MAX];
int matrixChain(int n);
void print(int i, int j);
int main() {
int N;
scanf("%d", &N);
for (int i = 0; i <= N; i++)
scanf("%d", &p[i]);
int res = matrixChain(N);
print... |
d39f507b35bc609984bf15ce2b8138a047570914 | d39e79b5a429878ca71cd4f276912f9d68fbd05e | zizaifeiyu/mypro | /test/n16to10.cpp | C++ | cpp | 762 | no_license | #include <iostream>
using namespace std;
long c16to10(const char *a)
{
long res = 0;
long len = strlen(a);
long weight = 16;
long p = 1;
long pos = 0;
if(len > 0 && a[0] == '-')
{
p = -1;
++pos;
}
while(pos < len)
{
long i = 0;
if(a[pos] >= '0' && a[pos] <= '9')
i = a[pos] -... |
197df6fd934b8cf3babea709e8000a8f807e2b85 | 15913687b4bd47c0f4b90d61e277d34a7b86b9f6 | decoz/opencv | /opencv_learn/src/mkcases.cpp | C++ | cpp | 1,754 | no_license | /*
* case xml 파일 생성을 용이하게 하기 위한 유틸 프로그램
*
* 사용법:
*
* mkcases -d"1 2 3 4 5 -l? -f case.xml -af *
* mkcases -D 1 2 3 4 5 -L?
*
* -a : append
*
*
*/
#include <opencv2/opencv.hpp>
#include <stdio.h>
#include <stdarg.h>
#include "dcLearn.h"
#include "classifier.h"
#include "dcFileLoader.h"
using namesp... |
c09deae87b9e8e0bedc56f461247fc917028a518 | b0b5281fed9fe9ead558d96588f1ef2a2ce4251f | Asupi/linux-code | /code/calc/calc_server.cc | C++ | cc | 775 | no_license | #include"tcp_thread_server.hpp"
#include<sstream>
int main()
{
TcpThreadServer server;
server.Start("0.0.0.0",9090,[](const std::string& req,std::string* resp){
// 1. 反序列化
std::stringstream ss(req);
int num1 = 0;
int num2 = 0;
std::string op;
... |
d7e7ebc3a0b24c230d0ed0c996591b7f0d2466bc | 87c12a852248502beda3291a067e5f05fd7024cb | microsoft/onnxruntime-tvm | /src/schedule/bound.cc | C++ | cc | 8,849 | 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 ... |
4d0059ae86dc347c6a88fee459667701fa9cd564 | 05d66df4d10c0c24ef2bda47af13e8caf3178272 | osukarusan/frr-assignments | /plugins/draw-occlusionquery/src/drawocclusion.cpp | C++ | cpp | 10,607 | no_license | #include "drawocclusion.h"
#include "glwidget.h"
#include "object.h"
#include "box.h"
#include <queue>
#include <utility>
DrawOcclusionQuery::DrawOcclusionQuery()
{
widget = new DrawOcclusionWidget();
}
QWidget* DrawOcclusionQuery::getPluginWidget()
{
return widget;
}
void DrawOcclusionQuery... |
6cc2cb9398d4aa75b96c7e2a04196bdc802c3b62 | 49122a4810e5cd1f3a299b41f38014def4721da9 | keesterbrugge/TDA361_2013_pathtracer | /Pathtracer/pathtracer/Pathtracer.cpp | C++ | cpp | 4,741 | no_license | #include <iostream>
#include "Pathtracer.h"
#include "ray.h"
#include <float2.h>
using namespace chag;
using namespace std;
Pathtracer::Pathtracer(void)
{
m_frameBuffer = NULL;
}
Pathtracer::~Pathtracer(void)
{
}
///////////////////////////////////////////////////////////////////////////
// ... |
fcdde291ae569c01e04ec3502c7ce8a527f2c099 | 80f5e13e3db2d97b70a4d50314eb12c25c1d96f3 | blackberry/Boost | /libs/context/performance/bind_processor_freebsd.cpp | C++ | cpp | 725 | permissive |
// Copyright Oliver Kowalke 2009.
// Distributed under 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)
#include "bind_processor.hpp"
extern "C"
{
#include <sys/param.h>
#include <sys/cpuset.h>
}
... |
ad06b148ee26ce70c5301e9411ab6e598e4fcdbc | 6a7e9e6af8c7a4799b1bd7ae146b4e418cead2c8 | TotalHansson/School-Projects | /lab-env/projects/half-edge_mesh_CCSubdivision/code/half-edge_mesh.cc | C++ | cc | 17,850 | permissive | #include "half-edge_mesh.h"
HEmesh::HEmesh()
{}
HEmesh::~HEmesh()
{
for (int i = 0; i < this->verts.size(); i++)
delete this->verts[i];
for (int i = 0; i < this->edges.size(); i++)
delete this->edges[i];
for (int i = 0; i < this->faces.size(); i++)
delete this->faces[i];
for (int i = 0; i < this->nor... |
cb1c1f1eb15d7dff4a7bbbfc590d3e9b244c21b1 | d4a633cc335617ca897c2276ebe3b27e385584fb | dragon-li/fatfrog | /jni/foundation/media/src/AHierarchicalStateMachine.cpp | C++ | cpp | 2,761 | no_license | /*
* Copyright (C) 2010 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... |
d20b64c0e64669907427212874dd2e45a14a936a | 01ae1cbbe9e04e0fd6d8f219cc7ecc2761ff56be | thegamer1907/Code_Analysis | /contest/1542571931.cpp | C++ | cpp | 806 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int hour,minu,sec,src,des;
cin>>hour>>minu>>sec>>src>>des;
if(sec>=1) minu++;
sec+=4;
sec/=5;
if(minu>=1) hour++;
minu+=4;
minu/=5;
if(sec == 0) sec = 12;
if(minu == 0) minu = 12;
if(hour>12) hour%=12;
int arr[15] = {0};... |
9ce83a4feedb6314502d31e7996957ae9aa0edc3 | 1da3f277985e06f6d345c3a1ac09e752d644674e | amitsadaphule/chromium | /chromeos/services/assistant/assistant_manager_service_impl.cc | C++ | cc | 62,754 | permissive | // Copyright 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 "chromeos/services/assistant/assistant_manager_service_impl.h"
#include <algorithm>
#include <utility>
#include "ash/public/interfaces/constant... |
37bd143b4e40916bb16151f67079aba3314abf75 | 4982095ced80762be895612aa2491d8b9c6ed216 | juno7803/Algorithm | /BruteForce/14500.cpp | C++ | cpp | 4,025 | no_license | #include <iostream>
using namespace std;
int a[500][500];
int main() {
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> a[i][j];
}
}
int ans = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) ... |
770207a4c16663cd749caed4a18786b356456251 | 239c2771d80c220fced7d5233064afa62f4a05b2 | staticfloat/liblsl | /lslboost/boost/core/is_same.hpp | C++ | hpp | 799 | permissive | #ifndef BOOST_CORE_IS_SAME_HPP_INCLUDED
#define BOOST_CORE_IS_SAME_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// is_same<T1,T2>::value is true when T1 == T2
//
// Copyright 2014 Peter Dimov
//
// Distributed under the Boost Software L... |
b7eac92b102d18ed9d73a77df7c60c174c021ea6 | e65e49624726c506a2b347b53e5010732d26cfa2 | laomd-2/high-performance | /lab4/matrix/main.cpp | C++ | cpp | 2,290 | no_license | //
// Created by laomd on 2018/10/2.
//
#include <iostream>
#include <fstream>
#include <divide.hpp>
#include <matrix_mul.hpp>
#include <vector_manip.hpp>
using namespace std;
int main() {
Init(0, 0);
Comm_Info info(MPI_COMM_WORLD);
ifstream matrix, vector_;
int matrix_size[4];
if (info.rank == 0)... |
2a878d6eb7b8c45cde5f75e68d52ae75bdb1a00f | 5cdacf9ec0a8d5832f50965d2712594bcca276fe | Nekomimi1958/NyanFi_x64 | /src/FindTag.cpp | C++ | cpp | 13,747 | permissive | //----------------------------------------------------------------------//
// NyanFi //
// タグ名の検索 //
//----------------------------------------------------------------------//
#include "UserFunc.h"
#include "UserMdl.h"
#include "Global.h"
#include "FindTag.h"
//----------------------------... |
870768d485ffa4f02e03b45a799c20cfa538fb21 | 128ce184ba19a307ae6824cd0d2b9fa3e583fa7e | EtienneTurc/PacmanOnline | /back/test/src_test/game_test.cpp | C++ | cpp | 914 | no_license | #include "game_test.h"
/*
UNIT TEST for GAME class
*/
TEST_F(GameTest, getPacmans_none) {
EXPECT_EQ(0, _game->getPacmans()->size());
}
TEST_F(GameTest, getPacmans_addPacman) {
_game->addPacman(*_pacman);
EXPECT_EQ(1, _game->getPacmans()->size());
std::vector<Pacman>* pacmans = _game->getPacmans();
EXPECT_EQ(1,... |
2ecf5a08e82258dd43b0c3222eef2d1b50ff99fc | b544952ca5af2bf2e8118fe5e57cca338549a527 | crcondes/assignments | /sum15/cs109/asg-2/main.cpp | C++ | cpp | 4,733 | no_license | // $Id: main.cpp,v 1.48 2015-07-02 16:48:18-07 - - $
//---------------------------------------------------------------------
// Name: Cecilia Condes
// ID: ccondes
// Class: cmps109
// Date: 16.7.15
// Filename: main.cpp
//-----------------------------------------------------------------... |
666c0308f54ee11308e11e3b1e2b2bd9cbb154c6 | 1726894960fa61da62c83daf4fef0f1b094bdbc2 | GamesTrap/LearnCPP | /IsCharSigned/src/main.cpp | C++ | cpp | 556 | permissive | #include <iostream>
int main()
{
if (std::numeric_limits<char>::is_signed)
std::cout << "char is interpreted as signed on this system." << '\n';
else
std::cout << "char is interpreted as unsigned on this system." << '\n';
std::cout << '\n' << "Limits for char, converted to int:" << '\n';
std::cout << "Minimum... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.