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 |
|---|---|---|---|---|---|---|---|---|
aeb8e02f2e6fe051efed8ddff6c9a3fa6f1112f8 | 385f2b41f26a30b7bbecf6650e701b3d29c62536 | Dakshin22/InterpretIF | /src/passagetokenizer.cpp | C++ | cpp | 5,748 | no_license | #include "storytokenizer.h"
#include "passagetokenizer.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <cctype>
#include <vector>
using namespace std;
//this program tokenizes html by extracting componenets from passages of a story, Dakshin Rathan
PartToken PassageTokenizer::nextPart()
{... |
740b6dfe49803654eb43ad25b3999bfc93b7e799 | 7ef8b79d083f61589b13ee639eaaf1cd6c850e56 | NatBelaya/AandDS | /BelayaNV_Lab6/No1/Main1.cpp | C++ | cpp | 3,092 | no_license | #include"Deque.h"
#include"Queue.h"
#include"Stack.h"
int main() {
bool e = true;
int struct_choice;
while (e) {
std::cout << "Select data structure (1: Stack, 2: Queue, 3: Deque) 4: Exit:";
std::cin >> struct_choice;
switch (struct_choice) {
//stack
case 1: {
int ITEM;
int choice;
Stack* stac... |
6bfacc506c757f1eeff6d6d3da24cd37dd327913 | a9f2f3770f7afef5219c8885a92cc19076180c5b | GregoryBen/cp-lib | /dsu.cpp | C++ | cpp | 443 | no_license | struct dsu {
int n;
vector<int> link;
dsu(int _n) : n(_n) {
link.resize(n);
iota(link.begin(), link.end(), 0);
}
inline int find(int x) {
return (x == link[x] ? x : (link[x] = find(link[x])));
}
bool same(int a, int b) {
return find(a) == find(b);
}
inline bool unite(int a, int b) ... |
5ddc70d9bfe16c671e4bcc70f3be63367a49b4fa | ad35944456983b6ced690eb830144332d1e83be2 | BambooMa/VC_openSource | /03 图形技术/03 图 片 效 果/003 电影胶片特效-例1/FilmMoveView/MainFrm.cpp | C++ | cpp | 2,406 | no_license | // MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "FilmMoveView.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
I... |
32ce8f55cd5996dcde772520eab92a7bcba466a2 | d610c6377be1b78948b034837c5d0a9c4cd48311 | SubhajitCode/Competitive-Programming | /HackerRank/InterviewPrep/Arrays/New Year Chaos/NYC.cpp | C++ | cpp | 4,613 | no_license | /*
t's New Year's Day and everyone's in line for the Wonderland rollercoaster ride! There are a number of people queued up, and each person wears a sticker indicating their initial position in the queue. Initial positions increment by from at the front of the line to at the back.
Any person in the queue can bribe t... |
56ea4d5d0d77f6aa7edc083c82869c401c287ee8 | f3d6efa148851096948494469f82ccad5ca59f24 | hczhcz/ClickHouse | /dbms/src/DataTypes/DataTypeDateTime.cpp | C++ | cpp | 6,370 | permissive | #include <IO/ReadHelpers.h>
#include <IO/WriteHelpers.h>
#include <IO/parseDateTimeBestEffort.h>
#include <common/DateLUT.h>
#include <Common/typeid_cast.h>
#include <Columns/ColumnsNumber.h>
#include <Formats/FormatSettings.h>
#include <Formats/ProtobufReader.h>
#include <Formats/ProtobufWriter.h>
#include <DataTypes... |
e73e74f5da01d4421060f6ca5cd476500854c1a0 | 04f02325824f79fe186a91a4ba212f6a0a66b8fc | blockidchain/blockidcoin | /src/test/serialize_tests.cpp | C++ | cpp | 5,049 | permissive | // Copyright (c) 2012-2013 The Bitcoin Core developers
// Copyright (c) 2019 The BlockidCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "serialize.h"
#include "streams.h"
#include "hash.h"
#include "... |
2d2f8c79331a9bca896e50bde0a729b429b1628e | 911771cb6d0ff3af7005d5956afe8818f001accd | Kawser-nerd/CLCDSA | /Source Codes/CodeJamData/17/42/2.cpp | C++ | cpp | 3,444 | no_license | #line 1 "B.cpp"
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <cassert>
#include <cmath>
#include <cstring>
#include <functional>
#... |
f0d35f11688da5cd3e4a46c182034fdd54b6f48d | 0aa04416c8931b688e74f47a1c2a535a0ed54d29 | Hichigo/Neuron | /Neuron/Source.cpp | C++ | cpp | 9,287 | no_license | #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <ctime>
using namespace std;
#define INPUT_NEURONS 4
#define HIDDEN_NEURONS 4
#define OUTPUT_NEURONS 4
double wih[INPUT_NEURONS + 1][HIDDEN_NEURONS];
double who[HIDDEN_NEURONS ... |
855508146ab2492c7077247b90148503bf389624 | 1b9fec0d6b8171818643d887e2fb9e605bf73426 | digint/openmptl-reg-arm-cortex | /arm/cortex/Freescale/MK60D10/include/arch/reg/aips0.hpp | C++ | hpp | 33,390 | no_license | /*
* OpenMPTL - C++ Microprocessor Template Library
*
* This program is a derivative representation of a CMSIS System View
* Description (SVD) file, and is subject to the corresponding license
* (see "Freescale CMSIS-SVD License Agreement.pdf" in the parent directory).
*
* This program is distributed in the hope... |
d1860652166799868e9164f6af2b3b3e627d7c9e | ae052c691f565714a98c89b210efc0982f5b7a21 | zenoalbisser/chromium | /chrome/test/base/extension_load_waiter_one_shot.cc | C++ | cc | 2,031 | permissive | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/test/base/extension_load_waiter_one_shot.h"
#include "base/callback.h"
#include "chrome/browser/chrome_notification_types.h"
#include "c... |
8ac071c27a7c196d628b0f74e99a3761ed5d36de | 422d825e34f16f832c7325d1be524fb42bf02d2d | chromium/chromium | /ui/display/mac/display_link_mac.cc | C++ | cc | 16,846 | permissive | // Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/display/mac/display_link_mac.h"
#include <stdint.h>
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/no_dest... |
714b6dd2a50ef56ada9eea2764f1ec5dd2ea1447 | 499bc723ca8d9b858e5fc32f2a4ea243c7f9928d | sxs-collaboration/spectre | /src/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/FixConservativesAndComputePrims.hpp | C++ | hpp | 2,395 | permissive | // Distributed under the MIT License.
// See LICENSE.txt for details.
#pragma once
#include <cstddef>
#include "DataStructures/Tensor/TypeAliases.hpp"
#include "Evolution/Systems/GrMhd/ValenciaDivClean/FixConservatives.hpp"
#include "Evolution/Systems/GrMhd/ValenciaDivClean/System.hpp"
#include "Evolution/Systems/Gr... |
2a89743b8985b0ecf1a23e9ef572ea1f61e1bf35 | e138b6ec9f85ec3ba442b0a6afb002c1e82ee53b | jpenco/C | /Revisao1.cpp | C++ | cpp | 434 | no_license | # include <stdlib.h>
# include <stdio.h>
# include <conio.h>
using namespace std;
void algarismo();
int main()
{
algarismo()
}
void algarismo()
int u, c, d, auxd, N, M;
printf("Insira o numero que deseja inverter: ");
scanf("%d", &N);
c=(int)N/100;
auxd=N-(c*100);
d=(int)auxd/10;
u=N-(... |
bbf36951914d091c607349253191f1160268d79a | b0df86e6c5f19a4dc6a688fc4f981bc389e55b5b | cekongsb/particl-core | /src/test/ringct_tests.cpp | C++ | cpp | 23,439 | permissive | // Copyright (c) 2017 The Particl Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <test/setup_common.h>
#include <crypto/sha256.h>
#include <key/stealth.h>
#include <secp256k1.h>
#include <secp256k1_ra... |
36d1e8c33d5ea85b6ad7cad639c66820fcfd8eae | 1655d218b97c274581213318aa1feffa1047b048 | lsils/mockturtle | /include/mockturtle/algorithms/resyn_engines/mig_resyn.hpp | C++ | hpp | 43,873 | permissive | /* mockturtle: C++ logic network library
* Copyright (C) 2018-2022 EPFL
*
* 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... |
843509e39febd9307878142696aabad91619abc9 | cf8994e236717f70f60da58259343d86ce2407f0 | YunlongNie/BayDR | /BayDR/src/CauEst.cpp | C++ | cpp | 1,701 | no_license |
/**
Causal <- apply(CSample,1,function(x)
{
tem <- gamma0+gamma2/sqrt(K)*(sum(x[seq(1,((r-2)*K),by=r)])-0.5*K)+
lambda2/sqrt(K)*(sum(x[seq(3,(r*K),by=r)]*x[seq(4,(r*K),by=r)])-Mean34*K)
(inv.logit(tem+gamma1+lambda1/sqrt(K)*(sum(x[seq(2,(r*K),by=r)])-0.5*K)) - inv.logit(tem))
}
)
*/
/* #inc... |
3dc374c42c596dd99cb870dcd26430d3ab246ed1 | a7658ff5db746f56feef1631a35eb004a7abbad8 | MlLHoUzE/Artificial-Intelligence-AStar | /theengine/TheEngine/cObjectEntity.cpp | C++ | cpp | 2,755 | no_license | #include "cObjectEntity.h"
#include "Render.h"
void cObjectEntity::SetMediator(iMediator* pMediator)
{
}
void cObjectEntity::GetPhysicsInfo(sPhysicsInfo& physicsInfo)
{
physicsInfo = this->m_physicsInfo;
}
void cObjectEntity::SetPhysicsInfo(sPhysicsInfo physicsInfo)
{
m_physicsInfo = physicsInfo;
}
void cObjec... |
50c08d115eead29133c1bc341b703e1ef02c00b2 | fe93fad6497df91b44b358e983c5065441fed7a3 | marco-c/gecko-dev-comments-removed | /third_party/libwebrtc/test/fuzzers/sdp_parser_fuzzer.cc | C++ | cc | 429 | permissive |
#include <stddef.h>
#include <stdint.h>
#include "api/jsep_session_description.h"
namespace webrtc {
void FuzzOneInput(const uint8_t* data, size_t size) {
if (size > 16384) {
return;
}
std::string message(reinterpret_cast<const char*>(data), size);
webrtc::SdpParseError error;
std::unique_ptr... |
82361908f3d4cc74decbc4aea618499517772fe6 | 113947f287bf3406696bcbc377a470a4b406882d | gem-sw/cmssw | /Validation/RPCRecHits/src/RPCValidHistograms.cc | C++ | cc | 14,350 | no_license | #include "Validation/RPCRecHits/interface/RPCValidHistograms.h"
#include "TAxis.h"
void RPCValidHistograms::bookHistograms(DQMStore* dbe, const std::string subDir)
{
if ( !dbe )
{
edm::LogError("RPCValidHistograms") << "DBE not initialized\n";
return;
}
if ( booked_ )
{
edm::LogError("RPCValidH... |
d3541155a180583f1e675ddb8c0447beb85eb3bb | d642be5eb70ada135a182fdd247b2167ab3bdc45 | kns-1/ncrwork | /Cdac Evaluation/StringClass/StringClass.cpp | C++ | cpp | 2,724 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
#define MAX 100
#define SIZE 3
using namespace std;
class MyStringClass
{
char *name;
int length;
public:
MyStringClass()
{
name = new char[MAX];
length = 0;
cout << "This is default constructor" << endl;
}
MyStringClass(int len)
{
le... |
ed99dc2c337a586dfc4f89512b5908a4cb44d537 | 71e4fddfa0f070b083b62974d0dc405061fe28ae | zhullyb/monyhar | /monyhar/components/exo/client_controlled_shell_surface_unittest.cc | C++ | cc | 106,852 | permissive | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/exo/client_controlled_shell_surface.h"
#include "ash/display/screen_orientation_controller.h"
#include "ash/frame/header_view.h"
#in... |
79cd816d6394714f6bf64acd5ee0133616bda964 | 6b87499779e28916d168527e7fbd3fe70b1f6e43 | nims11/coding | /SPOJ/AMR12G.cpp | C++ | cpp | 1,356 | no_license | /*
Nimesh Ghelani (nims11)
*/
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<string>
#include<vector>
#include<queue>
#include<cmath>
#include<stack>
#include<utility>
#define in_T int t;for(scanf("%d",&t);t--;)
#define in_I(a) scanf("%d",&a)
#define in_F(a) scanf("%l... |
89056e9f3cadd4abacdb14ecf625baa8eb6de830 | c7588970ddb426f1193829e551e725629561373a | wincash/Wincashcoin | /src/uint256.cpp | C++ | cpp | 11,142 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2017-2018 The WINCASHCOIN developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "uint256.h"
#inclu... |
73c934aff04ab440c9f2e30a35b46f1822679912 | 7d89ade06b813a8bd59e5bf5a757f03f868e2c0d | TheFinn98/EscapeRoom | /EscapeRoom2/startgamewindow.cpp | C++ | cpp | 307 | no_license | #include "startgamewindow.h"
#include "ui_startgamewindow.h"
startGameWindow::startGameWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::startGameWindow)
{
ui->setupUi(this);
}
startGameWindow::~startGameWindow()
{
delete ui;
}
void startGameWindow::on_startGameButton_clicked()
{
}
|
dbe8a498c5e8d408f6234cf473d22a71a5dc3afe | e15c19441b190443a73ca879b8d586fabcd9aa93 | zwfree/C-code | /28.4/main.cpp | C++ | cpp | 1,235 | no_license | #include <iostream>
#include<fstream>
#include<vector>
using namespace std;
int main()
{
fstream file("highscores.txt",ios::in|ios::out);
if(!file.is_open())
{
cout<<"Could not open file!"<<endl;
return 0;
}
int new_high_score;
cout<<"Please input a new high scor... |
3e740bb6fadbc5c4fcc3244651ead2bc44d7196c | 742848bf0aa5a777fe34b4f6c66a02c71a789e39 | sharingmarketcoin/sharingmarketcoin | /src/masternodeman.cpp | C++ | cpp | 28,469 | permissive | // Copyright (c) 2014-2015 The Sharingmarket developers
// Copyright (c) 2015-2017 The DASH developers
// Copyright (c) 2015-2017 The SMK developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "masternodeman.h"... |
8e1ffffcc3f1c449707aac21857b0b6c98a855aa | b9f6b909a2bb57ac3393b1604bc5b9b652bdf6ba | troylee/kaldi | /src/vtsbin/vts-acc-gmm-stats-ali.cc | C++ | cc | 6,464 | permissive | /*
* vts-acc-gmm-stats-ali.cc
*
* Created on: Nov 23, 2012
* Author: Troy Lee (troy.lee2008@gmail.com)
*
* Accumulate statistics for re-estimating the pseudo-clean HMM model.
*
*/
#include "base/kaldi-common.h"
#include "util/common-utils.h"
#include "gmm/am-diag-gmm.h"
#include "hmm/transition-model.h"... |
34ad89052747b7b8e264bb00bfb2cc389d988680 | 4aca54eda25178d17ebf7dcbba4c6ad57a01f569 | shawn-peng/counting-consistent-sub-DAG | /batch_graph_gen.cpp | C++ | cpp | 3,844 | no_license | #include "dag.h"
#include "dag_generator.h"
#include "graph_alg.h"
#include <string>
#include <iostream>
#include <cmath>
#include <ctgmath>
#include <random>
#include <ctime>
#include <sstream>
#include <set>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <boost/random... |
dbc61b0a6e1b9e08aa5ce4281d474e0dd0e67fb3 | ca409be8acc9b3a2fb95166507fb50cf1428193c | longcongduoi/JN516x-arduino-package | /libraries/SPI/SPI.cpp | C++ | cpp | 4,588 | no_license | /*
* Copyright (c) 2010 by Cristian Maglie <c.maglie@arduino.cc>
* Copyright (c) 2014 by Paul Stoffregen <paul@pjrc.com> (Transaction API)
* SPI Master library for arduino.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of either the GNU General Public License version 2... |
f51faea786488af0cd829823a3000cf63cb820e1 | 9c52a88a1b65e8bb6397b52528579fa6df3ad351 | BryceAllen613/112 | /lab04/MatrixTester.cpp | C++ | cpp | 14,460 | no_license | /* MatrixTester.cpp defines test-methods for class Matrix.
* Joel Adams, for CS 112 at Calvin College.
*/
#include "MatrixTester.h"
#include <iostream> // cout, cerr, ...
#include <cstdlib> // exit()
#include <stdexcept> // range_error, ...
using namespace std;
void MatrixTester::runTests() {
... |
98c0aed9cf65e4f2be7f9d08e340e0283d848bae | 73fd6dd5439bbb4b398991d8aeb337e667fb6314 | SergeyPezhemsky/ray-trace | /RayTracer.cpp | C++ | cpp | 7,454 | no_license | #include <limits>
#include "RayTracer.h"
#include "Material.h"
#include "Geometry.h"
#include <iostream>
#include "LightSource.h"
#include <random>
//Базовый алгоритм трассировки луча
float3 SimpleRT::TraceRay(const Ray& ray, const std::vector<std::shared_ptr<GeoObject>>& geo, const int& depth)
{
float tnear = std::n... |
fdc7c1ae5423f7bf59baa7d47ad19b2c6eb40c25 | 7fd92ff690e7d126cd4322f24b01c5300068acad | HosamEissa/Competitive-programming- | /Spoj/ACQUIRE.cpp | C++ | cpp | 5,749 | no_license | /*
Author: Hossam Eissa
Idea:
*/
#include <bits/stdc++.h>
using namespace std;
#define error(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }
vector<string> split(const string& s, char c)
{
vector<string> v;
stringstream ss(s);
string x;
while (getline(ss, x, c))
v.e... |
6a8ecedd4440d055ce6aa557a94fd6e1a5667a04 | 17ac3ed7a4f90e75cd74387372a18d3acfba092b | mathiaslyngbye/verify-sudoku | /sudoku.cpp | C++ | cpp | 2,177 | no_license | #include "sudoku.h"
#include <iostream>
Sudoku::Sudoku( std::array<std::array<int,9>,9> _map)
{
map = _map;
}
bool Sudoku::verify()
{
if(verifyRows() && verifyCols() && verifyBoxes())
{
return true;
}
return false;
}
bool Sudoku::verifyRow(int row)
{
int test[9] = {0};
for(int c... |
cd2fa5b12b9da4f4d950337eee5cadf1080a40bc | 3cfd53fae91c3332da80e5f624d299e6a77fdfd8 | dmkz/competitive-programming | /acmp.ru/0640.cpp | C++ | cpp | 2,148 | no_license | /*
"Test-The-Best": геометрия, преобразования фигур, O(n^2*log(n))
*/
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
typedef std::vector<char> Vector;
typedef std::vector<Vector> Matrix;
Matrix input() {
int nRows, nCols;
scanf("%d %d", &nRows, &nCols);
... |
487132faefc68d40468f56ac09e7edc28961a1d4 | 994f889eb88d91a91074888a02a67d9e8663fcbb | svarvel/browser-android-tabs | /chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc | C++ | cc | 11,790 | 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 <memory>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_strin... |
385d526b284b0d384ace766ff69747234434a231 | 24959f51a724dded81732e3a5477044427b69145 | Parent5446/hiphop-php | /hphp/runtime/ext/ext_function.cpp | C++ | cpp | 13,529 | permissive | /*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... |
b9a0c334edd8058fae3eb3e5429d50d9f07a87bc | 5cc446587fd70915d86e67bfccc09512b7b42a3d | AlphaLeaf/BOJ | /2178_미로 탐색.cpp | C++ | cpp | 1,772 | no_license | #include <iostream>
#include <queue>
#include <string>
using namespace std;
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int N, M, row, col, size;
string temp;
int walk = 1;//이동 횟수
queue<int> q;
cin >> N >> M;//N은 행 수, M은 열 수
int** maze = new int*[N];//미로 상태 나타내는 배열
bool** vis... |
f02148eb4ae3bed511283cc2e4160cffc0e32b87 | f65404b4906634efc70be5b63c7e60100644f2cc | Shuumatsu/sponge | /libsponge/tcp_sender.hh | C++ | hh | 4,413 | no_license | #ifndef SPONGE_LIBSPONGE_TCP_SENDER_HH
#define SPONGE_LIBSPONGE_TCP_SENDER_HH
#include "byte_stream.hh"
#include "tcp_config.hh"
#include "tcp_segment.hh"
#include "wrapping_integers.hh"
#include <deque>
#include <functional>
#include <queue>
class RetransmissionTimer {
bool _timer_running = false;
//! retr... |
35ba513c0a2b24987ee612797a41d76b5e8c08e0 | f1cd5e38b26b677248d9a2e971bc2418987c2398 | tekktonic/gzdoom | /src/gl/scene/gl_weapon.cpp | C++ | cpp | 12,994 | no_license | /*
** gl_weapon.cpp
** Weapon sprite drawing
**
**---------------------------------------------------------------------------
** Copyright 2002-2005 Christoph Oelckers
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the follow... |
06011bb7391e087a14b644c860467461207e9f0e | f5003a6ba8bfe514d1675a88981f24906b155c9c | vmagno/3D-fractal | /SDLWindow.cpp | C++ | cpp | 9,819 | no_license | #include "SDLWindow.h"
#include <iostream>
#include <GL/glew.h>
#include "CudaMath.h"
#include "DisplayItem.h"
#include "FractalObject.h"
#include "RayMarchingTexture.h"
#include "Util.h"
using namespace std;
const float FOVy = 35.f;
const float zNear = 0.1f;
const float zFar = 300.f;
SDLWindow::SDLWindow()
... |
2f4c20a46f9d845f32022a58b6ca9ac24f65d5df | 0461f0a86b6782041c9ef87b95122828385af6c8 | buihuynhduc/tooltest | /Juliet_Test_Suite_v1.3_for_C_Cpp/C/testcases/CWE789_Uncontrolled_Mem_Alloc/s02/CWE789_Uncontrolled_Mem_Alloc__new_wchar_t_fscanf_64b.cpp | C++ | cpp | 3,876 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE789_Uncontrolled_Mem_Alloc__new_wchar_t_fscanf_64b.cpp
Label Definition File: CWE789_Uncontrolled_Mem_Alloc__new.label.xml
Template File: sources-sinks-64b.tmpl.cpp
*/
/*
* @description
* CWE: 789 Uncontrolled Memory Allocation
* BadSource: fscanf Read data from the c... |
935ea7f67fb02a44650ac1e48c984223ef9843ec | c3cf279b39be5730769aa0ffc99674011f55ebc1 | arrayfire/arrayfire | /src/backend/cuda/kernel/reduce.hpp | C++ | hpp | 20,204 | permissive | /*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
**********************************************... |
4ccf0b091ab3a1385ae36821bf87d3c18d1fd821 | 4b0600310037e8caa8510512e1945de62c5ef8fe | zeph1912/milkomeda_chromium | /cc/trees/single_thread_proxy.cc | C++ | cc | 29,653 | permissive | // Copyright 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 "cc/trees/single_thread_proxy.h"
#include "base/auto_reset.h"
#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#inclu... |
5e0d155d40d64443060f30e7461462430b20ae98 | 75def195d42cd74a3f1eb85d9da804b4510f9337 | jbohn3353/LeetCode | /771. Jewels and Stones/771. Jewels and Stones.cpp | C++ | cpp | 1,356 | no_license | /* James Bohn
* 10/17/19
* Two solid solutions for LeetCode 771. Jewels and Stones.
* One solution is more time efficient, the other is more space efficient.
*/
#include <iostream>
#include <unordered_map>
#include <string>
using namespace std;
class Solution {
public:
// O(J+S) time, O(J) space
int numJewelsI... |
86dd3afcc118ece4a55aaafb8906c7b7b6e87362 | c66004eaf0f5c4f548895bf91d5100826e8bf671 | RebeccaCheng910/CHAMBER-CRAWLER | /ChamberCrawler/halfling.cc | C++ | cc | 204 | no_license | #include "halfling.h"
#include <string>
using namespace std;
Halfling::Halfling(int row, int col, char type): Enemy{row, col,type} {
HP = 100;
Atk = 15;
Def = 20;
}
Halfling::~Halfling() {}
|
43bb0cd159ca2bce56ef91f37a36df2a2678e67c | 71fd0869b151df5b453bb46300039791aac05ca5 | computersalat/fwbuilder | /src/unit_tests/ObjectMatcherTest/ObjectMatcherTest.cpp | C++ | cpp | 8,718 | no_license | /*
Firewall Builder
Copyright (C) 2010 NetCitadel, LLC
Author: Roman Bovsunivskiy a2k0001@gmail.com
$Id$
This program is free software which we release under the GNU General Public
License. You may redistribute and/or modify this program under the terms
of ... |
d93c0e9d9e52b96123b0597c1260309f9e06b5bb | 9ae1eea0145c499a970241c86ce73a603bc03187 | gobackhuoxing/CSYE6205 | /Assignment3-Barnes&Nobel/src/EmployeeFactory.cpp | C++ | cpp | 1,014 | no_license | /*
* EmployeeFactory.cpp
*
* Created on: 2018Äê3ÔÂ27ÈÕ
* Author: XiaoCase
*/
#include "EmployeeFactory.h"
#include "Employee.h"
namespace edu {
namespace neu {
namespace csye6205 {
EmployeeFactory::EmployeeFactory() {
// TODO Auto-generated constructor stub
}
EmployeeFactory::~Employ... |
a6aa4e938ddeb65bbe44ca42c3e3e09a8568a959 | 4d7421599d367d5f4346f8362d3d946c3a351353 | UFLX2MuMu/Ntupliser | /DiMuons/src/MhtInfo.cc | C++ | cc | 215 | no_license |
#include "Ntupliser/DiMuons/interface/MhtInfo.h"
void MhtInfo::init() {
pt = -999;
phi = -999;
MT = -999;
mass = -999;
pt_had = -999;
phi_had = -999;
MT_had = -999;
mass_had = -999;
}
|
63292efa7c8f7c717ebbd622033e2300390cbdcf | d4e294a18f29ce452f43a02190464696054fa4e2 | FenodyreeAv/gameEngine | /src/myengine/Core.cpp | C++ | cpp | 3,431 | no_license | #include "Core.h"
#include "Entity.h"
#include "Exception.h"
#include "Transform.h"
#include "Screen.h"
#include "ResourceList.h"
#include "Input.h"
#include <iostream>
#define WINDOW_WIDTH 800
#define WINDOW_HEIGHT 600
namespace myengine
{
std::shared_ptr<Core> Core::initialize()
{
std::shared_ptr<Core> rtn = s... |
adc1599f80466cf87e5e0b18d7de420f176e9b49 | 425db7583f23d25a80fcc40938eb8367ff6a2f94 | crosslore/moos-ivp-aro | /releases/moos-ivp-4.0.1/ivp/src/uHelmScope/HelmScope.cpp | C++ | cpp | 37,793 | no_license | /*****************************************************************/
/* NAME: Michael Benjamin and John Leonard */
/* ORGN: NAVSEA Newport RI and MIT Cambridge MA */
/* FILE: HelmScope.cpp */
/* DATE: Apr 12th 2008 ... |
66c67619e0c30451874d83c04e2ea2a24e39ef22 | f9c1bb8e7e6c464561974c5cfaf674734b0d2709 | mayankwasekar/Study | /C++/Programs/Templates/STL/sorttest.cpp | C++ | cpp | 582 | no_license | #include "interval.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <utility>
using namespace std;
using rel_ops::operator>;
int main(void)
{
vector<Interval> store;
store.push_back(Interval(4, 21));
store.push_back(Interval(7, 32));
store.push_back(Interval(5, 13));
s... |
a4a4194a347628caac51d6f2e23a62a7c007b1cf | edb3295ae60503e930540c3156e3e93afd8b67f2 | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE23_Relative_Path_Traversal/s03/CWE23_Relative_Path_Traversal__wchar_t_connect_socket_w32CreateFile_54c.cpp | C++ | cpp | 1,897 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE23_Relative_Path_Traversal__wchar_t_connect_socket_w32CreateFile_54c.cpp
Label Definition File: CWE23_Relative_Path_Traversal.label.xml
Template File: sources-sink-54c.tmpl.cpp
*/
/*
* @description
* CWE: 23 Relative Path Traversal
* BadSource: connect_socket ... |
1d85ff3c0640c5157f245a86934898eda75af7d2 | c79b19cdb1c96e29aaf149fdd17169e5aa1285bf | team2059/Dent | /Commands/Elevator/Lower.cpp | C++ | cpp | 584 | no_license | #include "Lower.h"
#include "../../DentRobot.h"
#include "../../OI.h"
Lower::Lower(double timeout): Command("Lower"){
SetTimeout(timeout);
}
void Lower::Initialize(){
}
void Lower::Execute(){
DentRobot::elevator->Run(-1.0);
}
bool Lower::IsFinished(){
if(!DentRobot::elevator->GetElevatorBottom()||IsTimedOut()){
... |
853219f2b39e0840250bd5e8d3556ea6a58e6d0d | 4f1463dfb4398d7338f2b4b10293be4c46e48540 | RibaldRhino/blue | /lib/glm/glm/gtc/type_ptr.hpp | C++ | hpp | 5,716 | no_license | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... |
9fee50ab83dee51b4c7d4aeab48ef4131304e30b | 64c5ddba8c14a30f6e64511fcc3838bd9b884b0c | jokhan/WAP | /FirstExam/Exam2/main.cc | C++ | cc | 3,776 | permissive | /*
* author: jokhan
* date: 2016.10.1
* function: main.cc
*/
#include <iostream>
#include <map>
using namespace std;
struct RoomNode {
int index;
RoomNode *next;
RoomNode( int x ): index(x), next(NULL){}
};
struct RoomHead {
int totalSati; // the satisfaction of room i if a router is put in it
RoomNode *... |
0bc67e5eda05ed6e7b02dee819555f0f3d2ac5de | 9e951bbfcdda0ddd74871bc0677b38a8978c34ff | Alex2772/Craftgame | /Craftgame/NetPlayerHandler.cpp | C++ | cpp | 5,945 | no_license | #include "NetPlayerHandler.h"
#include "GameEngine.h"
#include "ByteBuffer.h"
#include "P04ServerData.h"
#include "P00Disconnected.h"
#include "Utils.h"
#include "CraftgameServer.h"
#include "PHandshake.h"
NetPlayerHandler::NetPlayerHandler(Socket::Address& s):
address(s),
commandSender(nullptr)
{
lastPacket = std:... |
755651942022013fff5a5a7aa9707776831ed9ee | 12f198f7a3778cc13cc0add7d1786da5f882c6c0 | ranhaoliu/a-car-game-written-in-direct3d | /src/car game/LookAtCamera.cpp | C++ | cpp | 542 | no_license | #include "LookAtCamera .h"
using DirectX::XMMatrixLookAtLH;
LookAtCamera::LookAtCamera()
: position_(XMFLOAT3(0.0f, 2.0f, 0.0f)),
target_(XMFLOAT3(0.0f, 2.0f, 10.0f)),
up_(XMFLOAT3(0.0f, 1.0f, 0.0f))
{}
void LookAtCamera::SetPositions(XMFLOAT3 pos, XMFLOAT3 target)
{
position_ = pos;
target_ = target;
}
XMMATR... |
7d9ad578f3700fc02b5f7746c2edad6f6f18e530 | 4278cf7f7e12cbac41728d8fa9a97da50f414e64 | GoldenSword2018/GoldenSword | /CEnemy.cpp | C++ | cpp | 1,371 | no_license | //
// CEnemy.cpp
// Author:HIROMASA IKEDA DATE:2018/10/19
//===============================================
// 変更者 Changed By
// Name: DATE:
//
//-----------------------------------------------
// test
//===============================================
// インクルード include
//==============================================... |
8e602030cee5f9deeb95ded50dd0cb9be722ef01 | 390ab03754aed1ff8bb7ecfefbb343cd36adf3e5 | Daandelange/ofxDarkKnight | /libs/collections/basic.hpp | C++ | hpp | 1,555 | permissive | /*
Copyright (C) 2018 Luis Fernando García Pérez [http://luiscript.com]
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, c... |
fe929fa48f29e488f4516b15cf5b63986e83e887 | fbcce99f3a927c402bcc11ff4302fc4653052424 | justinrixx/Networked-Asteroids | /uiDraw.cpp | C++ | cpp | 16,756 | no_license | /***********************************************************************
* Source File:
* User Interface Draw : put pixels on the screen
* Author:
* Br. Helfrich
* Summary:
* This is the code necessary to draw on the screen. We have a collection
* of procedural functions here because each draw functi... |
134fa948fe114a6ca2cce385bd3c071fc8b9c39f | f894c1bad6b9ea12d3daa44dec061a1cc53e4365 | cms-nanoAOD/cmssw | /JetMETCorrections/Algorithms/src/L6SLBCorrectorImpl.cc | C++ | cc | 5,905 | permissive | ////////////////////////////////////////////////////////////////////////////////
//
// L6SLBCorrectorImpl
// --------------
//
// 25/10/2009 Hauke Held <hauke.held@cern.ch>
// Philipp Schieferdecker <philipp.schieferdecker@cern.ch
//////////////////////////////////////////... |
a37875962c864a28f8f4226e1f81f83d805709a8 | c5dab9621b428764d0f94848772896a65e87fe5c | Kap1bara/FindNumbers | /wrappers/wrappers.cpp | C++ | cpp | 1,394 | no_license | #include "wrappers.hpp"
#include <iostream>
void wBind(int fd, const SA *sa, socklen_t salen){
if (bind(fd, sa, salen) < 0)
throw 101;
}
void wListen(int fd, int backlog){
if (listen(fd, backlog) < 0)
throw 102;
}
int wAccept(int fd, SA *sa, socklen_t *salenptr){
int n=0;
if( (n=accept(fd,sa,salenpt... |
38655c4f3b1702371eb6ea9f49886472cc2bb7ce | c39553e0c89ecf75a537284ba54fa5314f217a9c | manvii3110/Data_Structure | /stack/stack_stl.cpp | C++ | cpp | 329 | no_license | #include <iostream>
#include <stack>
using namespace std;
int main() {
stack<int> stack;
stack.push(21);
stack.push(22);
stack.push(24);
stack.push(25);
stack.pop();
stack.pop();
while (!stack.empty()) {
cout << ' ' << stack.top();
stack.pop();
}
}
//Outp... |
2dd2ee5f5113e16c28f8b9d1bb4d0722892439bd | 80acd49e61a60f4248e1301a2b2b6edbc427ab55 | RaoXuntian/Learn_CPP | /CPPP_5th/chapter_2/2_3_2.cpp | C++ | cpp | 415 | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char const *argv[])
{
int *p1 = nullptr; //空指针
int *p2 = NULL; //空指针
int *p3 = 0; //空指针
cout << "p1 = " << p1 << endl;
cout << "p2 = " << p2 << endl;
cout << "p3 = " << p2 << endl;
int i = 0;
int *p = &i;
cout << "p = " << p
<<... |
0b465474e2f8578fc51474e0a3a0562adb06e718 | 08d6600219a642022ed429c6f7dec99ca19c3d73 | jsyhdl/tmas | /code/branches/no-template/src/protocol/l7/l7_monitor.cpp | C++ | cpp | 1,733 | no_license | /*#############################################################################
* 文件名 : l7_monitor.cpp
* 创建人 : teck_zhou
* 创建时间 : 2014年01月02日
* 文件描述 : L7Monitor类实现
* 版权声明 : Copyright (c) 2014 BroadInter. All rights reserved.
* ##########################################################################*/
#inc... |
1de65bcf9f8d6836f06c294f84e9749ba3d9237d | 7ac346aeaa9ba0fbff20d789d4c609748476eecf | TencentCloud/tencentcloud-sdk-cpp | /vpc/src/v20170312/model/UnassignIpv6CidrBlockRequest.cpp | C++ | cpp | 2,657 | permissive | /*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
... |
3952d02db6ebfe271831e1db2de4755260070ee4 | 251a07fa53a5090611ec701f1f332fc9787fb307 | tranermr/Arduino-PID-Library | /PID_v1.cpp | C++ | cpp | 8,661 | permissive | /**********************************************************************************************
* Arduino PID Library - Version 1.1.1
* by Brett Beauregard <br3ttb@gmail.com> brettbeauregard.com
*
* This Library is licensed under a GPLv3 License
*********************************************************************... |
72eb9eb27e9aa2fabdfece35d03cff05fdbe99c4 | ecf1fb417f61018ea9b4b8da52a6ed231b56b2d7 | jun20061588/codefeeling | /test/cpp/test_cpp_tmp_vec.cpp | C++ | cpp | 906 | no_license | #include <gtest/gtest.h>
#include <vector>
#include <iostream>
std::vector<int> get_tmp() {
std::vector<int> tmp = {1, 2, 3, 4};
return tmp;
}
TEST(cpp_concept, TmpVectorDoubleCall) {
std::vector<int> shape0 = get_tmp();
std::vector<int> shape2 = std::vector<int>(shape0.begin(), shape0.end());
ASSERT_E... |
9af9c8368412eeabba0c3f963aa59b255ac2433b | 8d81bb3bfc4b5fec9de16d79b46903f5cbd01aae | HieronyM/Competitive-Programming-Code | /TOKI - Latihan/BAB 4 Complete Search/4B.Complete Search II/maze.cpp | C++ | cpp | 2,213 | no_license |
// Template by Hierony
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
using namespace std;
typedef pair<int,int> pii;
#define REP(i,n) for(int (i) = 0; (i) < (int)(n); (i)++)
#define RESET(c,v) memset(c, v, sizeof(c))
#define mp make_pair
#define sI(val) scanf("%d",&val)
#define sID(val,... |
5090fa1ca80d41a035cb194d0d04648c140861df | 00fb588edc284f4873c707b19dd4503f399ea88a | frstrtr/boost_tutorials | /cookbook/ch01/06_Resolving_a_DNS_name_TCP.cpp | C++ | cpp | 1,295 | no_license | #include "../common/logging.h"
#include <asio.hpp>
int main() {
auto console = logging::setup();
// Step 1. Assume that the client application has already obtained the DNS name and protocol port number and
// represented them as strings.
std::string host = "samplehost.com";
std::string port_num = "3333";
... |
1437b621758ac044a06a0fa530371583cee7c78c | cac28d5a6c26a65d5764a9be0665dc1339d5752b | shreyasoni15/Recursions | /A4B_Q5.cpp | C++ | cpp | 334 | no_license | #include <iostream>
using namespace std;
void odd_even (int ch, int n, int sum){
if(ch<=n){
sum+=ch;
odd_even((++(++ch)),n,sum);
}
else
cout<<"Sum equals:"<<sum;
}
int main() {
int ch,n,sum;
cout<<"Enter 0 for EVEN or 1 for ODD:";
cin>>ch;
cout<<"Enter terminating number:";
cin>>n;
odd_even(ch,n,sum);... |
3675384d3db369ed796db13cc551e11f25db3029 | 3582cbf211518e4e4406924421532de0e5e331f0 | wayfinder/Wayfinder-Server | /Server/Modules/src/SearchUnit.cpp | C++ | cpp | 2,999 | no_license | /*
Copyright (c) 1999 - 2010, Vodafone Group Services Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of condit... |
13f0147d71c1a9e07af28e3a4623f1c5f6ff5637 | 651f16179e3297f0d3c76e930c265d3e30302adb | jeffreyfox/Data-Structures | /search/test_tree.cpp | C++ | cpp | 6,805 | no_license | #include "BSTree.h"
#include "RBTree.h"
#include "IntervalTree.h"
extern ostream& operator<<(ostream& os, const vector<double>& vec);
extern ostream& operator<<(ostream& os, const vector<int>& vec);
void swap(int &a, int &b)
{
int t = a; a = b; b = t;
}
void randPerm(vector<int>& num)
{
int n = num.size();
for(... |
6d84c50f4bdf3b33d9cb16f6d24497ee482c585b | f33eaaa45359f26923cbff9b005c4d47cc89894b | opensourceyouthprogramming/h5vcc | /external/chromium/chrome/browser/extensions/api/usb/usb_api.cc | C++ | cc | 18,974 | 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/usb/usb_api.h"
#include <string>
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "chrome/brow... |
284fe6726509a5436402defbe39201a72d09699f | 737fbb90d620d5a01bf1a7b451ac8ccb66ba1f1c | Simon-GitHub/Test_VS | /LibcurlTest/ftpupload.hpp | C++ | hpp | 3,320 | no_license | /*****************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___... |
a7062bb13a2f8fbc88ac855b8e2f874fad7b2170 | 2af243f313d71826a9709055d463160b25865de7 | astronaut0131/PAT | /PAT_Basic_Level/1021. 个位数统计.cpp | C++ | cpp | 310 | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int num[10];
int main(){
fill(num,num+10,0);
string s;
cin>>s;
for(int i=0;i<s.length();i++){
int temp=s[i]-'0';
num[temp]++;
}
for(int i=0;i<=9;i++){
if(num[i]!=0){
cout<<i<<":"<<num[i]<<endl;
}
}
return 0;
}
|
6180193a07c054b6a269d9ca50b557fd99098a9f | d9abc5dbd1cdaaefdb8350013da3a60fc7af9c9b | szh-bash/ACM | /bzoj__orzliyicheng/p1997.cpp | C++ | cpp | 1,832 | no_license | #include <map>
#include <cmath>
#include <ctime>
#include <queue>
#include <cstdio>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define N 8005
#define M 60*10000
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
int n, m, k, ct, cnt, tot, f[N... |
030100aa30465857d60616281bc13791f6b25cca | 10ff56c3b1f4f5a86e7238768f9fbbcd50318866 | diegopego/Qt4xHb | /source/QDataWidgetMapper.cpp | C++ | cpp | 11,294 | permissive | /*
Qt4xHb - bibliotecas de ligação entre Harbour/xHarbour e Qt Framework 4
Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>
*/
#include <QDataWidgetMapper>
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbvm.h"
#include "hbstack.h"
#ifndef __XHARBOUR__
#includ... |
1108d6fa3b8703b5e605951b8dd0f968c3a24fca | 225e9cb4bdb909233bb11b4682ea8eecbb556648 | caixianzhang/key_management_base_SM9 | /Alice/main.cpp | C++ | cpp | 1,743 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <iostream>
#include <unistd.h>
#include <libgen.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/sms4.h>
#include <openssl/is_gmssl.h>
#include "main.h"
#include "sm4-cbc.h"
#include "sm9-encrypt.h"
#include "s... |
c58f3d724bc5d1638a2803000b186574fa80430b | 4bbd979093bcfcfbce435c22929a2a3119a97166 | Simon-0801/CodeHome | /Codeforces/2020WinterTraining/2-2.cpp | C++ | cpp | 963 | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
const int maxn = 200000 + 5;
ll num[maxn],cp[maxn];
map<ll,int> mp;
int main() {
int n,m,k;
scanf("%d%d%d... |
c4fdfaa85d6f786ead780c5689d9c7ba47846ad1 | 1361e823384dcbb9c9ba738531aaee44e0a5edd8 | abhishek555/Experiments-with-OpenCL | /Sobel/Sobel/cll.cpp | C++ | cpp | 4,519 | no_license | #include "cll.h"
#include<iostream>
#include<string>
#include"util.h"
using namespace std;
CL::CL()
{
cout<<"Constructor CL\n";
clock_t begin=clock();
err=cl::Platform::get(&platforms);
if(err!=CL_SUCCESS)
{
cout<<"Platform";
return;
}
string platform_name;
string device_type;
cout<<"Number of Platforms A... |
c1c0e874eca78f8b96c87a5ff9339d63ac4069d8 | f49e9f3e3ae8c69b679036e62713c0d611ded7d1 | iamarshsingh/Competative_programming | /Codeforces/Educational Round 65/D.cpp | C++ | cpp | 936 | no_license | #include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
int main(){
//fastio
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int n;
cin>>n;
string s;
cin>>s;
vector<... |
1451464c2dd362ed642e521252e809d59fe4fe29 | 58f899086495e1cea598febea4eb2a0f40edaa57 | quinsmpang/foundations.github.com | /build/pc/ACDK_4_14_0/acdk/acdkx_orb/src/acdkx/orb/RequestOutputStream.cpp | C++ | cpp | 2,279 | no_license | // -*- mode:C++; tab-width:2; c-basic-offset:2; indent-tabs-mode:nil -*-
//
// Copyright (C) 2000-2005 by Roger Rene Kommer / artefaktur, Kassel, Germany.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public License (LGPL).
//
//
// This ... |
0ef5f39a017644c8a27b819bbb56866d111e15ec | dfddaa028f11a1e36c78d6856536ffc16dac765b | liupanpan/Socket_Gateway | /socket_server_t.cpp | C++ | cpp | 1,693 | no_license | #include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <iostream>
#include <netinet/tcp.h>
#include <signal.h>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <sys/select.h>
#include <sys/socket.h>
#include <time.h>
#include <unistd.h>
#include "Socket_Server_T.hpp"
Socket_Server_T::So... |
c81309e6b1635785ae589bf59410123f7a654ece | 20eef766ae6ee19d8e8143a76a20ab218d44f38a | nmostafa/ngraph | /src/ngraph/runtime/reference/maximum.hpp | C++ | hpp | 1,741 | permissive | //*****************************************************************************
// Copyright 2017-2020 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://w... |
e5417f301fd30c33efb01a186e4ffd92f1778e1c | c43ef01a1d8f76c51b9f258927db6fd2c9537576 | resurgo/powerlyra | /src/graphlab/graph/distributed_graph.hpp | C++ | hpp | 141,267 | permissive | /*
* Copyright (c) 2013 Shanghai Jiao Tong University.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE... |
920a4dbc86708c1c60a362dd4fc67e4c14feb5d9 | 073949b6194e16ee12172f1351e20067fe32f483 | Simon-GitHub/EasyGifTool | /Demos/BezierCurve.cpp | C++ | cpp | 3,681 | no_license | #include "BezierCurve.h"
#include <QPainter>
#include <QVBoxLayout>
#include <QMouseEvent>
BezierCurveWidget::BezierCurveWidget(QWidget *parent)
:QWidget(parent)
{
m_StartPos = QPoint(100, 100);
m_EndPos = QPoint(600, 600);
m_CtrolPos1 = QPoint(100, 600);
m_CtrolPos2 = QPoint(600, 100);
}
BezierCu... |
1502cb5aa07d68a12abf6fb0919d70ad6dcf28fa | a14b1635a5491fe1a18063a5e1b67ed365a4751d | ViteFalcon/RokLegend | /source/core/RoConfig.cpp | C++ | cpp | 2,794 | permissive | ////////////////////////////////////////////////////////////////////////////////
// This source code is part of RokLegend project.
// (Ragnarok Online Client)
// Copyright (c) RokLegend Team, 2013
////////////////////////////////////////////////////////////////////////////////
#include "RoConfig.h"
#includ... |
67578353463495099f9df1d7cdb5502b43646a52 | 734c09b4221f4afbf6e14f6dce920389bbb3bb91 | Yonghui56/ComponentialMultiphase | /ogsNumerics/SolutionLib/Fem/FemNeumannBC.cpp | C++ | cpp | 2,016 | permissive | /**
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.com)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.com/LICENSE.txt
*
*
* \file FemNeumannBC.cpp
*
* Created on 2012-08-03 by Norihiro Watanabe
... |
e35ed7ac4f0c3bd7e5d7d4ed19716e03503b1ea1 | 16609c98a0147374a5ff97098d1c6a1c735144ea | azchatlanin/juce-examples | /JBWindow/Source/MainWindow/MainWindow.cpp | C++ | cpp | 2,340 | no_license | #include "MainWindow.h"
#include "../CentralComponent/CentralComponent.h"
#define tr(s) String::fromUTF8(s)
MainWindow::MainWindow(String name)
: DocumentWindow(name,
Desktop::getInstance().getDefaultLookAndFeel().findColour(
ResizableWindow::backgroundColourId),
... |
4a1f5ab941e2c983e735e418beb095de1ff33b26 | b8264ec5507140b811329de31d1864343e79c925 | quynhhgoogoo/OOP-C- | /ex31.cpp | C++ | cpp | 451 | no_license | #include <iostream>
using namespace std;
int main(void) {
int i, *p, **q;
i=100;
p=&i;
q=&p;
//Here we print the content (value) of q, which is the address of p
cout<<"\nThe content of q: q="<<q<<endl;
//Here we print the content (value) of p, which is the address of i
cout<<"\nThe content of p: *q="<... |
5e22e22487ba5c4cede3b88200037cf28bcfdc6c | d218cb4297c3fa030134b8d1ed3ff774266570d8 | tanishqg5325/CodeChef | /KFIB.cpp | C++ | cpp | 407 | no_license | #include <iostream>
using namespace std;
int main()
{
long long n,k,sum,a=1000000007;
cin>>n>>k;
if(n<=k || k==1)
cout<<1<<endl;
else
{
int ar[n];
for(int i=0;i<k;i++)
ar[i]=1;
sum=k;
for(int i=k;i<n;i++)
{
ar[i]=sum;
... |
51dc01d9a967a345e3304938710c7217c4027f0a | 0d57aa7264dc755ff89778e11220faf120f88d8d | mayssabouzid/Smart_Factory_2A4 | /agence.cpp | C++ | cpp | 1,504 | no_license | #include "agence.h"
#include <QSqlQuery>
#include <QSqlQueryModel>
agence::agence()
{
}
agence::agence(QString a,QString z,QString e,QDate r,int t,int y,int u) {
id=a ;
nom=z ;
adresse=e ;
date_creation=r ;
nb_emp=t;
cin_directeur=y ;
nb_vente=u ;
}
bool agence:: ajouter() {
//boo... |
52c828ee43ef844e9cd67b8080b8b4d34147b2fc | 6092ca60f2dfad105b827ceb8b09ec6750fe5fff | bevilla/R-Type | /Client/src/Ship.cpp | C++ | cpp | 456 | no_license | //
// Ship.cpp for in /home/noel_f/rendu/tmpRTYPE/Client
//
// Made by Gabriel NOEL
// Login <noel_f@epitech.net>
//
// Started on Sat Jan 16 14:01:24 2016 Gabriel NOEL
// Last update Sun Jan 24 17:40:27 2016 Gabriel NOEL
//
#include "Ship.hpp"
void Ship::init(sf::Texture &swagg, int du, int poney)
{
setTextur... |
8ce05de2cb223c5b209edd062a3904cabfb77454 | ca64517853671591a7aeea14e8cc6676069b3f71 | tiny-ant/electron | /shell/browser/api/electron_api_web_contents.cc | C++ | cc | 138,427 | permissive | // Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/api/electron_api_web_contents.h"
#include <limits>
#include <memory>
#include <set>
#include <string>
#include <unordered_set>
#include <utility>
#include <vec... |
270ef483ac21f6a81e74807b747c71810f8b0f1c | 9debb6689f0a0d45f4d5d19465eeaa541c77c597 | koba24/BurnCoinWallet | /src/util.cpp | C++ | cpp | 42,773 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "util.h"
#include "sync.h"
#include "version.h"
#include "ui_interface.h"... |
3d3f07a554049669e83dd9ca958a24e1fc409573 | b2b9bbad4be6fa2971d613a6ecbd8355e1de1fa6 | lxw618/chromium | /components/exo/wayland/clients/info.cc | C++ | cc | 11,825 | permissive | // Copyright 2017 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 <iomanip>
#include <iostream>
#include <string>
#include <vector>
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base... |
8ea9974f6849f47aa0a3bc1a976fa215c267f667 | de6dee0a2561054248fa7ddcc8a036622cc1c9dd | zakuro9715/OpenSiv3D | /Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/System/CSystem.hpp | C++ | hpp | 779 | permissive | //-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (c) 2008-2022 Ryo Suzuki
// Copyright (c) 2016-2022 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# pragma once
# include <atomic>
# include <Si... |
8662cbf225553c155ddce97ba668aa24b9aa96be | cd137e63ba8434837ec342beb7f668611f912118 | bd4874/dsa-revision-notes | /11 Linked List/164MaximumValueInaLinkedList.cpp | C++ | cpp | 1,126 | no_license | // Maximum element in Linked List
// Author: REET
#include <iostream>
using namespace std;
struct Node
{
int data;
struct Node *next;
} * first;
void create(int A[], int n)
{
int i;
struct Node *t, *last;
first = new Node;
first->data = A[0];
first->next = NULL;
last = first;
for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.