text string | size int64 | token_count int64 |
|---|---|---|
#include "usagetracking.h"
#include <QDebug>
static int num_files_open=0;
static int64_t num_bytes_allocated=0;
static int malloc_count=0;
static int num_bytes_read=0;
static int num_bytes_written=0;
FILE *jfopen(const char *path,const char *mode) {
//printf("jfopen.\n");
FILE *F=fopen(path,mode);
if (!F) return 0... | 1,502 | 645 |
bool detect_anagram(char* src, char* anagram)
{
int isrc=0, iana=0;
while(*src != '\0') {
char* iter = anagram;
while(*iter != '\0' && *src != ' ') {
if(*src == *iter) {
iana++;
break;
}
iter++;
}
if(*src != ' ')... | 577 | 195 |
#ifndef _TESTFORCE_PLUGIN_HH_
#define _TESTFORCE_PLUGIN_HH_
#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/math/gzmath.hh>
#include <gazebo/physics/Link.hh>
#include <thread>
#include "ros/ros.h"
#include "ros/callback_queue.h"
#include "ros/subscribe_options.h"
#include "std_msgs/Fl... | 8,684 | 3,185 |
#pragma once
/**
* \file sal/memory.hpp
* Iterator and memory pointer helpers.
*/
#include <sal/config.hpp>
#include <iterator>
#include <memory>
__sal_begin
namespace __bits {
template <typename T> constexpr bool is_const_ref_v = false;
template <typename T> constexpr bool is_const_ref_v<const T &> = true;
... | 2,640 | 908 |
#pragma once
#include "Symbol.hpp"
namespace cru::parse {
class CRU_PARSE_API Nonterminal : public Symbol {
public:
Nonterminal(Grammar* grammar, String name);
CRU_DELETE_COPY(Nonterminal)
CRU_DELETE_MOVE(Nonterminal)
~Nonterminal() override;
};
} // namespace cru::parse
| 285 | 105 |
#ifndef __Timing_hpp__
#define __Timing_hpp__
void tic( const char* label = 0 ) ;
void toc( const char* label = 0 ) ;
struct Tick
{
Tick( const char* alabel = 0 ) : label( alabel ) { tic( label ); }
~Tick() { toc( label ); }
const char* label;
};
#endif /* __Timing_hpp__ */
| 295 | 120 |
//
// Created by Dennis Trukhin on 21/04/2018.
//
#include <iostream>
#include "Word.h"
Word::Word(const char * word) {
for (int i = 0; i < 4; i++) {
w[i] = (unsigned char)word[i];
}
}
Word::Word(const unsigned char * word) {
for (int i = 0; i < 4; i++) {
w[i] = word[i];
}
}
unsigned... | 945 | 408 |
#include "uiinfra/fixeditemproxymodel.h"
#include "simpletreemodel.h"
#include <gtest/gtest.h>
#include <qstandarditemmodel.h>
#include <qstringlistmodel.h>
void PrintTo(const QString& str, ::std::ostream* os)
{
*os << str.toStdString();
}
namespace inf::ui::test {
using namespace testing;
class FixedItemProx... | 2,642 | 934 |
// The MIT License (MIT)
//
// Copyright (c) 2015 dinowernli
//
// 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... | 3,471 | 1,246 |
#include "Renderer.hpp"
| 24 | 9 |
#include "macrothread.h"
MacroThread::MacroThread() {
}
void MacroThread::init(QHash<QString, QStringList> macro, int time) {
this->abort = false;
this->macro = macro;
this->sequenceTime = time;
if(sequenceTime <= 0) {
sequenceTime = 1000;
}
}
void MacroThread::stopThread() {
this->a... | 1,489 | 437 |
/*
Write a Program to find the minimum number of powers (sum of all those numbers) that are
required to form the given input number and print those numbers.
*/
#include<bits/stdc++.h>
#include<cmath>
using namespace std;
int main(int argc, char const *argv[])
{
int n = 20,count=0,flag=0;
int powers[n],res=0,j... | 811 | 292 |
// This file is part of mlog
#ifndef MLOG_STRING_BUILDER_HPP_
#define MLOG_STRING_BUILDER_HPP_
#include "fwd.hpp"
namespace mlog {
//
class StringBuilder {};
} // namespace mlog
#endif // !MLOG_STRING_BUILDER_HPP_ | 220 | 95 |
#include "global.h"
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
using namespace Gdiplus;
UINT num = 0; // number of image encoders
UINT size = 0; // size of the image encoder array in bytes
ImageCodecInfo* pImageCodecInfo = NULL;
GetImageEncodersSize(&num, &size);
if (size == 0)
... | 2,119 | 878 |
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | 4,212 | 1,392 |
#include<cstdio>
| 17 | 8 |
#include "Scheduler.h"
#include "FCFSStrategy.h"
int main() {
FCFSStrategy fcfs;
Scheduler scheduler(fcfs);
scheduler.addProcess("A");
scheduler.addProcess("B");
scheduler.addProcess("C");
scheduler.addProcess("D");
scheduler.run(8);
return 0;
}
| 279 | 106 |
// Bipartite Graph
// ---------------
// You can divide all the vertices of graph in 2 sets
// such that all edges of the graph are from set1 to set2
// Two Coloring
/// How to flip colors between 1 and 2 ?
// Use 3-color
// 3-2 = 1 and 3-1 = 2
#include <iostream>
#include <vector>
using namespace std;
boo... | 1,558 | 655 |
#include<iostream>
#include<cstdio>
#define rg register
#define rep(i,x,y) for(rg int i=(x);i<=(y);++i)
#define per(i,x,y) for(rg int i=(x);i>=(y);--i)
using namespace std;
const int N=2e5+10;
int n,t,k,a[N],v[N];
int main(){
scanf("%d%d%d",&n,&t,&k);
rep(i,2,t+1)scanf("%d",&a[i]);
int mink=0,maxk=n-t;
a[1]=1;
rep... | 536 | 335 |
#include "RadonFramework/precompiled.hpp"
#include "RadonFramework/Text/StringUtils/Base64.hpp"
#include "RadonFramework/backend/stringcoders/modp_b64.h"
namespace RadonFramework::Text::StringUtils {
RF_Type::String Base64Converter::Encode(const RF_Type::String &Source)
{
std::string str = modp::b64_encode(Source... | 645 | 233 |
#include "iw/iw.pb.h"
#include "iw/matching/cbir/full/full.h"
#include "snap/deluge/deluge.h"
#include "snap/google/base/hashutils.h"
#include "snap/google/glog/logging.h"
using namespace std;
using namespace deluge;
/*
class Mapper : public HadoopPipes::Mapper {
public:
Mapper(HadoopPipes::TaskContext& context) {
... | 2,172 | 743 |
#include <iostream>
#include "vigenere.h"
using namespace std;
int main()
{
vigenere k;
int choice;
cout << "VIGENERE ENCRYPTION & DECRYPTION" << endl;
cout << "------------------------------" << endl << endl;
do
{
cout << "Press 1 For Encryption" << endl;
cout << "Press 2 For ... | 1,300 | 361 |
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
double p, q, c, dollars;
cout << "Enter number of Pesos: ";
cin >> p;
cout << "Enter number of Guatemalan Quetzals: ";
cin >> q;
cout << "Enter number of Salvadoran Colons: ";
cin >> c;
dollars = 0.049 * p + 0.1305 *... | 425 | 186 |
// Generated from /POI/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
#include <org/apache/poi/hssf/extractor/EventBasedExcelExtractor.hpp>
#include <java/io/IOException.hpp>
#include <java/lang/IllegalStateException.hpp>
#include <java/lang/NullPointerException.hpp>
#include <java/lang/RuntimeExcept... | 4,907 | 1,685 |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2020 - 2022 Pionix GmbH and Contributors to EVerest
#ifndef OCPP1_6_GETCONFIGURATION_HPP
#define OCPP1_6_GETCONFIGURATION_HPP
#include <boost/optional.hpp>
#include <ocpp1_6/ocpp_types.hpp>
#include <ocpp1_6/types.hpp>
namespace ocpp1_6 {
/// \brief Contains a OCP... | 2,304 | 663 |
/*
** EPITECH PROJECT, 2020
** Vulkan-Engine
** File description:
** GPUEntityMgr.cpp
*/
#include "EntityCore/Core/VulkanMgr.hpp"
#include "EntityCore/Core/BufferMgr.hpp"
#include "EntityCore/Resource/SetMgr.hpp"
#include "EntityCore/Resource/Set.hpp"
#include "EntityCore/Resource/PipelineLayout.hpp"
#include "EntityCo... | 17,549 | 6,519 |
#include "cg_local.h"
#include "FX_Public.h"
/*
-------------------------
-------------------------
// PROTON GUN
-------------------------
-------------------------
*/
/*
-------------------------
FX_ProtonShockRing
-------------------------
*/
void FX_ProtonShockRing( vec3_t start, vec3_t end )
{
vec3_t shot_d... | 6,861 | 3,735 |
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* ----... | 2,012 | 594 |
// chrono.hpp --------------------------------------------------------------//
// Copyright 2009-2011 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef AUTOBOOST_CHRONO_CHRONO_HPP
#define AUTOBOOST_CHRONO_CHRONO_HPP
#inclu... | 483 | 200 |
// Problem Link : https://www.codechef.com/problems/SUBINC
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define Mod 1000000007
#define Infinity (ll)1e18
#define Append(a) push_back(a)
#define Pair(a,b) make_pair(a,b)
#define Clear(a)... | 1,413 | 638 |
//--------------------------------------------------------------------
//
// Laboratory C timer.cpp
//
// SOLUTION: Implementation of the Timer ADT
//
//
// from "A Laboratory Course in C++ Data Structures" (Roberge,Brandle,Whittington)
//-------------------------------------... | 1,033 | 263 |
#include "font_renderer.h"
#include "solar/utility/assert.h"
#include "solar/utility/verify.h"
#include "solar/utility/type_convert.h"
#include "solar/resources/resource_system.h"
#include "solar/rendering/primatives/prim2d.h"
#include "solar/rendering/shaders/shader_program.h"
#include "solar/strings/string_marshal.h"... | 5,487 | 2,208 |
#ifndef TEXTNET_LAYER_SPLIT_LAYER_INL_HPP_
#define TEXTNET_LAYER_SPLIT_LAYER_INL_HPP_
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <mshadow/tensor.h>
#include "../layer.h"
#include "../op.h"
namespace textnet {
namespace layer {
template<typename xpu>
class Split... | 4,119 | 1,526 |
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQuick module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid comme... | 25,688 | 8,062 |
#include <rho/crypt/tReadableAES.h>
#include <rho/eRho.h>
#include <algorithm>
#include <cstdlib>
namespace rho
{
namespace crypt
{
tReadableAES::tReadableAES(iReadable* internalStream, nOperationModeAES opmode,
const u8 key[], nKeyLengthAES keylen)
: m_stream(internalStream),
m_buf(NULL), m... | 5,174 | 2,007 |
// Adapted from ffmpeg. Look at libavcodec/adpcm{,_data}.{c,h}
/*
* Portions Copyright (c) 2001-2003 The FFmpeg project
*
* FFmpeg 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; either
* version... | 4,674 | 2,170 |
//
// Created by alberto on 13/03/19.
//
#include "RouteSequenceDecomposition.h"
namespace genvrp {
void RouteSequenceDecomposition::operator()(genvrp::Population& population, const SolverStatus& status) {
// If the problem does not have enough individuals, skip decomposition.
if(params.data.nbCli... | 4,961 | 1,351 |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
#include "... | 1,727 | 631 |
// see LICENSE
//! \author Ryzhenko Nikolai, 10984646, nikolai.v.ryzhenko@intel.com
//! \date Mon Oct 16 13:21:31 2017
//! \file suWireManager.cpp
//! \brief A collection of methods of the class suWireManager.
// std includes
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vec... | 28,642 | 10,204 |
#include <iostream>
#include "Solution1.h"
void test(vector<int> vec, int val) {
Solution s;
int res = s.removeElement(vec, val);
for (int i = 0; i < res; ++i) {
cout << vec[i] << " ";
}
cout << endl;
}
int main() {
test({1}, 1);
test({1}, 2);
test({3, 2, 2, 3}, 3);
return ... | 324 | 140 |
/* ============================================================================================== *
* *
* Galaxia Blockchain *
* ... | 3,271 | 724 |
#include "App.h"
#ifdef ESP_PLATFORM
extern "C" void app_main()
#else
int main(int /*argc*/, char** /*argv*/)
#endif
{
g3::App app{};
app.start();
}
| 163 | 73 |
//
// laserDispatch.cpp
// ofxSmartLaser
//
// Created by Clark Addis on 5/31/17.
//
//
// TODO
//
// [ ] have a way to specify which points are to be the starting points and/or what path they should take
//
// [ ] better way than laser polys to send polygons to laser
//
// [ ] make setting up a laser poly bette... | 3,558 | 1,155 |
/**
* @file effects.cpp
*
* Implementation of functions for loading and playing sounds.
*/
#include "all.h"
#ifndef NOSOUND
#include <SDL_mixer.h>
#include "utils/soundsample.h"
#endif
DEVILUTION_BEGIN_NAMESPACE
int sfxdelay;
int sfxdnum;
#ifdef NOSOUND
const int sgSFXSets[NUM_SFXSets][NUM_CLASS... | 108,161 | 54,323 |
#include "FrameNotes.h"
#include "ui_FrameNotes.h"
#include "mainwindow.h"
FrameNotes::FrameNotes(QWidget *parent) :
QFrame(parent),
ui(new Ui::FrameNotes)
{
_bLock=true;
_pMainWindow=nullptr;
ui->setupUi(this);
_bLock=false;
}
FrameNotes::~FrameNotes()
{
delete ui;
}
string FrameNotes::... | 733 | 296 |
#include "readData.h"
#include <fstream>
#include <string>
#include <algorithm>
Barcodes readBarcodes() {
Barcodes out;
// File pointer
std::fstream fin;
// Open an existing file
fin.open(std::string(DATASET_PATH) + "SLAM_dataset/Barcodes.dat", std::ios::in);
if (!fin)
std::logic_error("File not found");
/... | 8,240 | 4,256 |
#include <iostream>
using namespace std;
float getBMI(float weight, float height);
int main()
{
float m, h, bmi;
cin >> m >> h;
bmi = getBMI(m, h);
if (bmi<18.5)
{
cout << "Underweight";
}
else if (bmi>=18.5 && bmi<24)
{
cout << "Normal";
}
else
{
cout << bmi << endl << "Overweight";
}
return 0;... | 428 | 197 |
//##===----------------------------------------------------------------------===##//
//
// Author: Nathan Phipps 12/30/20
//
//##===----------------------------------------------------------------------===##//
#ifndef NP_ENGINE_CONTAINER_HPP
#define NP_ENGINE_CONTAINER_HPP
#include "NP-Engine/Foundation/Foundation.h... | 2,944 | 1,046 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int X[143], n;
while (cin >> X[0] && X[0]) {
for (n=1; cin>>X[n] && X[n]; ++n);
int Y[20000] = {};
for (int i=0; i<n; ++i) {
int p = X[i] << 1;
for (int j=0; j<=18000; j+=p)
++Y[j],
... | 693 | 306 |
#include<bits/stdc++.h>
#include<stdint.h>
using namespace std;
#define IOS {cin.tie(0);ios_base::sync_with_stdio(false);}
#define N 50006
#define int int64_t
const int INF = 1e6;
struct treap{
treap *l,*r;
int key,pri,sz,data,keytag,datatag;
treap(int _k,int _d):key(_k),data(_d),sz(1),pri(rand()),keyt... | 3,192 | 1,715 |
/*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
tree.hxx
Abstract:
This module contains the definition of the TREE class.
The TREE class implements a tree utility functionally compatible
with the DOS 5 tree utility.
This utility displays the directory structure of a path or drive.
... | 2,407 | 1,064 |
#include "pc_renderer.h"
#include "GL/glew.h"
#include "TextureManager.h"
#include "common.h"
#include "component_camera.h"
#include "glm/glm.hpp"
#include "mesh.h"
#include "pc_shaderprogram.h"
#include "renderer.h"
#include "resource.h"
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/transform.hpp>
glm::mat4 PC_Ren... | 13,738 | 5,848 |
// Copyright (c) 1992-2005. Ken Kahn, Animated Programs, All rights reserved.
#if !defined(__TT_DEFS_H)
#include "defs.h"
#endif
#if !defined(__TT_GLOBALS_H)
#include "globals.h"
#endif
#if !defined(__TT_STRINGS_H)
#include "strings.h"
#endif
#if !defined(__TT_SPRITE_H)
#include "sprite.h"
#endif ... | 44,877 | 16,689 |
/**
* @file main.cpp
* @brief This project builds a discrete 3-D map from environment information
* and Implements the A* algorithm to plan the path from Start to Goal Point.
*
* @author Vaibhav Bhilare
* @copyright 2017, Vaibhav Bhilare
*
* MIT License
* Copyright (c) 2017 Vaibhav Bhilare
*
* Permission is ... | 5,258 | 1,914 |
#include "radix_sort.h"
void radixSort(std::vector<int>& v) {
}
| 70 | 32 |
/*
Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain ... | 8,601 | 2,894 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iot/model/FleetMetricNameAndArn.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
nam... | 1,343 | 522 |
/*
* Copyright (C) 2021 Open Source Robotics Foundation
*
* 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 appl... | 2,631 | 837 |
#include "Email.hpp"
void sendEmail()
{
CURL *curl;
CURLcode res = CURLE_OK;
struct curl_slist *recipients = NULL;
struct upload_status upload_ctx;
upload_ctx.lines_read = 0;
curl = curl_easy_init();
if(curl) {
/* Set username and password */
... | 4,477 | 1,196 |
/*********************************************************************
*
* Software License Agreement (BSD License)
*
* Copyright (c) 2008, 2013, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the ... | 8,509 | 3,093 |
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct t{
int l_index; //index in bwt string
int f_index; //index in suffix array
t(int f_index): f_index(f_index) {};
};
inline int con(char x){
if (x == '$') return 0;
if (x == 'A') return 1;
if (x == 'C') retur... | 1,878 | 911 |
#pragma once
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
#include <array>
#include <string_view>
#include <algorithm>
#include <ranges>
namespace Projection
{
enum Projection
{
ORTHO, PERSPECTIVE
};
const std::array projectionStrings
{
"Ortho", "Perspective"
};
inline const char* ToString(Project... | 2,527 | 932 |
//
// Created by root on 19-4-17.
//
#include <cstdio>
#include <cstring>
#include <netinet/in.h>
#include "udp.h"
#include "ethernet.h"
#include "ipv4.h"
udp::udp(unsigned char *packet) {
unsigned int first;
memcpy(&first, packet + ethernet::HEADER_LENGTH + ipv4::HEADER_LENGTH, 4);
first = ntohl(first);... | 1,326 | 510 |
#include "node-llvm.h"
#include "value.h"
using namespace node;
using namespace v8;
namespace jsllvm {
void Value::Init(Handle<Object> target)
{
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
s_ct = Persistent<FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetI... | 2,157 | 794 |
//SKEET INVITE GENERATOR
//MADE BY JAKBES#5483
//100% REAL NO FAKE
#include <string>
#include <stdio.h>
#include <ctime>
#include <iostream>
#include <cstdlib>
//random includes, i dont really know if all of them are useful
using namespace std;
const int MAX = 100;
string skeetcodegen(int n)
{... | 1,188 | 512 |
#ifndef ReceiveTransportWrapper_h
#define ReceiveTransportWrapper_h
#import <Foundation/Foundation.h>
#import "MediasoupClientMediaKind.h"
#ifdef __cplusplus
namespace mediasoupclient {
class RecvTransport;
}
class ReceiveTransportListenerAdapter;
#endif
@class ConsumerWrapper;
@class RTCPeerConnectionFactory;
@pro... | 2,073 | 653 |
#pragma once
#include <fstream>
#include <iostream>
#include <ostream>
#include <sstream>
#include <string>
#include "City.h"
#include "dijkstra.h"
#include "input_parser.h"
void print_result(const int start, const int end)
{
if(start==end)
{
std::cout<<"Start city and end city are the same.";
return;
}
int ... | 1,720 | 803 |
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif // !WIN32_LEAN_AND_MEAN
#include <d3d11.h>
#include <d3d12.h>
#include <windows.h>
#endif
#include <vulkan/vulkan.h>
#define XR_NO_PROTOTYPES
#include "XR/IUnityXRTrace.h"
#include "openxr/openxr.h"
#include "openxr/openxr_platform.h"
#inclu... | 1,726 | 692 |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
using nam... | 2,107 | 577 |
// https://www.hackerearth.com/practice/data-structures/stacks/basics-of-stacks/practice-problems/algorithm/sniper-shooting/description/
// More efficient version of the previous code
#include<bits/stdc++.h>
#define MAX 1003
using namespace std;
typedef long long ll;
int main()
{
ll N,temp;
vector<ll> line;
... | 842 | 349 |
/*
* Configuration.cpp
*
* Created on: Oct 25, 2019
* Author: theater
*/
#include "Configuration.h"
void Configuration::print() {
Serial.println("###########################################");
String simulated = isSimulated ? "true" : "false";
Serial.printf("Simulated=%s \n", simulated.c_str... | 7,944 | 2,615 |
#pragma once
/*
* ============================================================================
*
* Authors: Prashant Pandey <ppandey@cs.stonybrook.edu>
* Rob Johnson <robj@vmware.com>
*
* ============================================================================
*/
#ifndef... | 785 | 294 |
#include<iostream> //we need this for cin, cout
using namespace std;
int main ()
{
int n, digit, remaining;
cout<<"Enter your number:";
cin>>n;
remaining = n;
do {
digit = remaining%10;
cout<<digit<<endl;
remaining = remaining/10;
} while(remaining >= 10);
digit = remainin... | 359 | 130 |
#include <sstream>
#include <iostream>
#include <ydk/entity_util.hpp>
#include "bundle_info.hpp"
#include "generated_entity_lookup.hpp"
#include "Cisco_IOS_XR_sysadmin_asic_errors_ael.hpp"
using namespace ydk;
namespace cisco_ios_xr {
namespace Cisco_IOS_XR_sysadmin_asic_errors_ael {
AsicErrors::AsicErrors()
:
... | 322,731 | 112,110 |
#include "ParallelProcess.h"
#include "ThreadPool.h"
using namespace Gadgetron::Core;
namespace Gadgetron::Server::Connection::Nodes {
void ParallelProcess::process_input(GenericInputChannel input, Queue &queue) {
ThreadPool pool(workers ? workers : std::thread::hardware_concurrency());
for (a... | 1,715 | 467 |
/* @STSHELL_LICENSE_START@
*
* __ _______ ___________
* / |/ / __ \/ ___/_ __/
* / /|_/ / / / /\__ \ / /
* / / / / /_/ /___/ // /
* /_/ /_/\____//____//_/
*
* Multi-Objective System Tuner
* Copyright (c) 2007-2022 Politecnico di Milano
*
* Development leader: Vittorio ... | 26,553 | 9,628 |
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
class Graph {
int numVertex;
vector<int> *adj;
public:
// Constructor to initialise graph
Graph(int numVertex) {
this->numVertex = numVertex;
adj = new vector<int> [numVertex];
}
// Function to add edge between source and d... | 1,352 | 553 |
#ifndef _CISCO_SYSLOG_MIB_
#define _CISCO_SYSLOG_MIB_
#include <memory>
#include <vector>
#include <string>
#include <ydk/types.hpp>
#include <ydk/errors.hpp>
namespace cisco_ios_xe {
namespace CISCO_SYSLOG_MIB {
class CISCOSYSLOGMIB : public ydk::Entity
{
public:
CISCOSYSLOGMIB();
~CISCOSYSLOGM... | 12,621 | 4,056 |
#ifndef STATICK_PYBIND_LINEAR_MODEL_HPP_
#define STATICK_PYBIND_LINEAR_MODEL_HPP_
#include "statick/array.hpp"
#include "statick/pybind/def.hpp"
#include "statick/linear_model/model_logreg.hpp"
namespace statick_py {
namespace logreg {
template <typename T, typename DAO>
void fit_d(DAO &dao, py_array_t<T> &a, py_arr... | 2,177 | 991 |
//<Snippet1>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>
#using <System.dll>
using namespace System;
using namespace System::ComponentModel;
using namespace System::ComponentModel::Design;
using namespace System::Collections;
using namespace System::Drawing;
using namespace System::IO;
... | 7,481 | 2,270 |
#include "ramqgitem.h"
QRectF RamQGItem::boundingRect() const
{
return QRectF(this->mapFromScene(200*this->data->zoomXPer,-250*this->data->zoomYPer),
QSizeF(150*this->data->zoomXPer,390*this->data->zoomYPer));
}
void RamQGItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid... | 4,386 | 1,644 |
// AcmiTape.cpp
// File created : 2017-9-23
//
//
// Last update : 2017-11-4
// By loitho
// Originally written by Jim DiZoglio (x257) as ACMIView class
// previous last modified: 9/25/97 Michael P. Songy
// Yes, that was 20 years ago
/* STFU _CRT_SECURE_NO_WARNINGS */
#pragma warning(disable:4996)
#include <vecto... | 30,149 | 11,565 |
#ifndef POTENTIAL3D_H
#define POTENTIAL3D_H
#include "Potential.hpp"
class Potential3D: public Potential{};
#endif
| 119 | 54 |
#include "AttackFSM.hpp"
#include <memory>
#include "Antagonist.hpp"
#include "Collider.hpp"
#include "Collision.hpp"
#include "Player.hpp"
#include "Sprite.hpp"
AttackFSM::AttackFSM(GameObject& object) : IFSM(object, ZERO_SPEED) {
auto ant_cpt = object.GetComponent(Types::AntagonistType);
if (!ant_cpt) {
thr... | 1,747 | 658 |
vector<int> rotateLeft(int d, vector<int> arr) {
int i = 0; // declaring a temporarily variable to store the number of steps
while(i < d){
int temp = *arr.begin(); // storing the first element in the vector to a temporarily variable
arr.erase(arr.begin()); // erasing the first element
arr... | 521 | 139 |
//https://leetcode.com/problems/get-equal-substrings-within-budget/discuss/392837/JavaC%2B%2BPython-Sliding-Window
class Solution {
public:
int equalSubstring(string s, string t, int maxCost) {
int len = s.size();
int i = 0;
for (int j=0; j<len; ++j){
if((maxCost -= abs(s[j]-t[j... | 447 | 170 |
#include "dragon/utils/math_functions.h"
#include "dragon/utils/op_kernels.h"
namespace dragon {
namespace kernels {
namespace {
template <typename T>
void _Tile(
const int num_dims,
const int64_t* x_dims,
const int64_t* x_strides,
const int64_t* y_dims,
const T* x,
T* y) {
const auto N = ... | 1,711 | 687 |
#include <iostream>
#include <vector>
#include <sstream>
#include <algorithm>
/* Program description:
* Program is simulating a process scheduler. Program executes with three arguments (arguments description below).
* Program works in step mode i.e. firstly it reads input from stdin if there is any, secondly it exec... | 10,703 | 3,272 |
#include <iostream>
#include <memory>
// -----------------------------------------------------------------------------
// PATTERN (dynamic polymorphism)
// -----------------------------------------------------------------------------
struct weapon_slot {
virtual char const* use() = 0;
virtual ~weapon_slot()... | 1,696 | 553 |
/**
* Copyright 2022 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | 5,551 | 1,934 |
#include <QFont>
#include "utils.h"
#include "treemodel.h"
TreeItem::TreeItem(TreeItem *parent)
: m_parent(parent)
{
}
TreeItem::~TreeItem()
{
qDeleteAll(m_children);
}
TreeItem* TreeItem::child(int number)
{
return m_children.value(number);
}
int TreeItem::childCount() const
{
return m_children.c... | 3,832 | 1,237 |
#include <Audio.h>
#include <SPI.h>
#include <ST7735_t3.h> // Hardware-specific library
#include <TeensyEurorack.h>
// GUItool: begin automatically generated code
AudioInputTDM tdm1; //xy=257,403
AudioRecordQueue queue1; //xy=527,243
AudioOutputTDM tdm3; //xy=67... | 3,325 | 1,377 |
#ifndef TEST_UNIT_MATH_REV_SCAL_FUN_UTIL_HPP
#define TEST_UNIT_MATH_REV_SCAL_FUN_UTIL_HPP
#include <stan/math/rev/scal.hpp>
#include <test/unit/math/rev/scal/util.hpp>
typedef stan::math::var AVAR;
typedef std::vector<AVAR> AVEC;
typedef std::vector<double> VEC;
AVEC createAVEC(AVAR x) {
AVEC v;
v.push_back(x);
... | 1,737 | 954 |
#include <string>
#include "gtest/gtest.h"
#include "../battle_system/entity.h"
TEST(Reference, Constructor)
{
std::string name = "shelby";
auto entity = CEntity(name);
ASSERT_EQ("shelby", entity.getName());
ASSERT_EQ("", name);
}
TEST(Reference_EmptyName, Constructor)
{
ASSERT_THROW({
... | 1,331 | 476 |
#include "proseco_planning/action/actionSpace.h"
#include <cstddef>
#include <random>
#include <stdexcept>
#include <variant>
#include "proseco_planning/action/actionSpaceRectangle.h"
#include "proseco_planning/collision_checker/collisionChecker.h"
#include "proseco_planning/math/mathlib.h"
#include "proseco_planning... | 3,126 | 940 |
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int main(int argc, const char **argv) {
std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
int n = 0, a = 0, b = 0, ans = 0;
unordered_multiset<int> h;
vector<int> g;
cin >> n;
while (n--) {
cin ... | 473 | 208 |
#pragma once
#pragma warning(push, 0)
#include <DSP/MLDSPOps.h>
#pragma warning(pop)
namespace ml {
class RampGen
{
public:
RampGen(int p = kFloatsPerDSPVector) : mCounter(p), mPeriod(p) {}
~RampGen() {}
inline void setPeriod(int p) { mPeriod = p; }
inline DSPVectorInt operator()()
{
DSPVectorInt vy;
for ... | 528 | 260 |
#include "CsvParse.h"
using namespace std;
CsvParse::CsvParse(shared_ptr<istream> stream)
:m_stream(stream)
{
}
static CsvParse::Status doEof(shared_ptr<istream>& stream)
{
if (stream->bad()) {
return CsvParse::StreamError;
}
stream.reset();
return CsvParse::RowRead;
}
static CsvParse::S... | 2,294 | 734 |
#include <bits/stdc++.h>
using namespace std;
#define SIZE 500010
class Edge {
public:
int to, next, len;
};
Edge edges[SIZE << 1];
int head[SIZE], edgesPt;
int vertexNum, lim; long long int dp[SIZE][2];
void addEdge(int from, int to, int len) {
edges[edgesPt] = {to, head[from], len};
head[from] = edges... | 1,544 | 668 |
#include "heap.h"
#include "gtest/gtest.h"
TEST(MaxHeapTest, EmptyHeap) {
MaxHeap<int> heap;
ASSERT_TRUE(heap.empty());
}
TEST(MaxHeapTest, AddingSingleElement) {
MaxHeap<int> heap;
heap.push(10);
EXPECT_EQ(heap.peek(), 10);
EXPECT_EQ(heap.size(), 1);
}
TEST(MaxHeapTest, AddingMultipleElements) {
MaxHe... | 1,183 | 594 |