text string | size int64 | token_count int64 |
|---|---|---|
/*
* Copyright 2015-2017, Intel Corporation
* Copyright 2018, Marius Berge Eide
*
* 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
* ... | 24,899 | 9,264 |
#include <stdio.h>
int main() {
int num;
scanf_s("%d", &num);
for(int i = 1; i <= num; i++) {
if (num % i == 0) {
printf("%d, ",i);
}
}
}W | 159 | 91 |
#ifndef __HAZ_ENUM_FLAG
#define __HAZ_ENUM_FLAG
#include <haz/Tools/Macro.hpp>
#include <type_traits>
#define ENUM_FLAG(name, bloc_enum...)\
BEG_NAMESPACE_HAZ_HIDDEN namespace enumFlagNamespace { \
enum class UNIQUE_NAME(name) \
bloc_enum; \
} END_NAMESPACE_HAZ_HIDDEN \
typedef haz::__hide::en... | 3,701 | 1,394 |
// Copyright 2022 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | 13,072 | 4,056 |
/**
* Copyright 2014-2017 Steven T Sell (ssell@vertexfragment.com)
*
* 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 requir... | 6,614 | 1,691 |
/*
* Copyright (c) 2000 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
*
* Contact: Rafal Krypa <r.krypa@samsung.com>
*
* 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
*
... | 2,867 | 931 |
#include <library.h>
#include "../../os_host/source/framework/Console.h"
using namespace BIOS;
#include "simcom.h"
// https://dweet.io/follow/la104simcom900
// https://dweet.io/dweet/for/la104simcom900?counter=10123
// https://dweet.io/get/latest/dweet/for/la104simcom900
int gReset = 0;
class CMyHttpReceiver : pub... | 4,878 | 1,893 |
#include <iostream>
#include <cstdlib>
#include <thread> // std::thread
#include <mutex> // std::mutex, std::unique_lock
#include <condition_variable>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#i... | 8,870 | 3,655 |
// Do not remove the include below
#include "arduino_signalbox.h"
#include "Timer.h" // https://github.com/dniklaus/arduino-utils-timer
#include "ToggleButton.h" // https://github.com/dniklaus/arduino-toggle-button
#include "Blanking.h" // https://github.com/dniklaus/arduino-utils-blanking
#include "P... | 1,843 | 888 |
#ifndef CMAKE_IMAGE_H
#define CMAKE_IMAGE_H
#include <string>
#include <opencv4/opencv2/opencv.hpp>
#include <boost/filesystem.hpp>
namespace ImageProcessor {
struct Image {
Image(){};
Image(cv::Mat const image, std::string const filename,
std::string const output_folder)
: image_{image}, filename_... | 999 | 299 |
#include <iostream>
#include <mji/algorithm.hpp>
#include <mji/math.hpp>
#include <mji/memory.hpp>
#include <mji/xplat.hpp>
int main(int argc, char** argv) {
(void)argc;
(void)argv;
std::cout << "tests passed!" << '\n';
return 0;
}
| 252 | 108 |
#include <future>
#include <iostream>
#include "api.hpp"
int main(int argc, char* argv[]) {
auto stack = std::async(std::launch::async, mstack::init_stack, argc, argv);
int fd = mstack::socket(0x06, mstack::ipv4_addr_t("192.168.1.1"), 30000);
mstack::listen(fd);
char buf[2000];
... | 708 | 253 |
// Utility Functions :: Test
//
#include "Utility_Test.h"
| 63 | 26 |
/* SPDX-License-Identifier: BSD-2-Clause-Patent
*
* Copyright (c) 2016-2019 Intel Corporation
*
* This code is subject to the terms of the BSD+Patent license.
* See LICENSE file for more details.
*/
#include "base_wlan_hal_dummy.h"
#include <beerocks/bcl/beerocks_string_utils.h>
#include <beerocks/bcl/beerocks_... | 3,656 | 1,258 |
// Copyright (c) Zhirnov Andrey. For more information see 'LICENSE.txt'
#include "Core/STL/Common/Platforms.h"
#if defined( PLATFORM_BASE_POSIX ) and defined( GX_USE_NATIVE_API )
#include "Core/STL/OS/Posix/SyncPrimitives.h"
namespace GX_STL
{
namespace OS
{
/*
=================================================
c... | 6,490 | 1,993 |
// Copyright (c) 2011 Ole Weidner, Louisiana State University
//
// This is part of the code examples on the SAGA website:
// http://saga-project.org/documentation/tutorials/job-api
#include <saga/saga.hpp>
int main(int argc, char* argv[])
{
try
{
// create an "echo 'hello, world' job"
saga::job::des... | 1,078 | 384 |
/**
* Copyright (C) 2018-present MongoDB, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but W... | 19,728 | 6,418 |
#include <lock_free_set.hpp>
namespace nonblocking
{
template<> versioned<lock_free_set::bucket_state>::versioned(unsigned int version, lock_free_set::bucket_state value) : _version{version}
{
switch (value)
{
case lock_free_set::bucket_state::empty: _value = 0; break;
c... | 8,692 | 2,614 |
#include "CharacterDialogSpritesPage.h"
#include <QVBoxLayout>
CharacterDialogSpritesPage::CharacterDialogSpritesPage(QWidget *parent) :
Page<Character>(parent)
{
isActive = false;
QVBoxLayout *pMainLayout = new QVBoxLayout();
pEmotionManipulator = new ListManipulator<Character::DialogEmotion>();
... | 955 | 316 |
// file : libbuild2/cc/module.cxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
#include <libbuild2/cc/module.hxx>
#include <iomanip> // left, setw()
#include <libbuild2/scope.hxx>
#include <libbuild2/function.hxx>
#include <libbuild2/diagnostics.hxx>
#include <libbuild2/bin/target.hxx>
#inclu... | 36,782 | 11,555 |
//==========================================================================
// ObTools::Crypto: test-pkcs5.cc
//
// Test harness for Crypto library PKCS5 padding functions
//
// Copyright (c) 2006 Paul Clark. All rights reserved
// This code comes with NO WARRANTY and is subject to licence agreement
//===============... | 1,068 | 325 |
//2014.02.09 Gustaf - CTG.
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout << "TEST Searching for a Specific Value \n";
const int ARRAY_SIZE = 10;
int intArray[ARRAY_SIZE] = {4, 5, 9, 12, -4, 0, -57, 30987, -287, 1};
int targetValue = 12;
int targetPos = 0;
while ((intArr... | 577 | 243 |
#include <chrono>
#include <iostream>
#include <string>
#include <thread>
#include "librf.h"
using namespace resumef;
using namespace std::chrono;
//_Ctype签名:void(bool, int64_t)
template<class _Ctype, typename=std::enable_if_t<std::is_invocable_v<_Ctype, bool, int64_t>>>
static void callback_get_long_with_stop(stop... | 2,358 | 1,281 |
/* PSYCHO GAMES(C) STUDIOS - 2007 www.psychogames.net
* Project: Vulture(c)
* Author : Andrea Nardinocchi
* eMail : andrea@nardinan.it
*
* 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, ... | 34,879 | 12,026 |
/// PROJECT
#include "sample_consensus.hpp"
namespace csapex
{
using namespace connection_types;
class Ransac : public SampleConsensus
{
public:
Ransac() = default;
void setupParameters(Parameterizable& parameters) override
{
SampleConsensus::setupParameters(parameters);
parameters.addPa... | 5,076 | 1,488 |
// 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 "chromecast/android/cast_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "base/macros.h"... | 1,362 | 465 |
/*
* Warhammer Age of Sigmar battle simulator.
*
* Copyright (C) 2019 by Rick Weyrauch - rpweyrauch@gmail.com
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
#include <algorithm>
#include <sylvaneth/DrychaHamadreth.h>
#include <UnitFactory.h>
#include <spells/MysticSh... | 6,147 | 2,238 |
#include "pixelbuf.h"
#include <assert.h>
#include "util.h"
#include "coordinates.h"
PixelBuf::PixelBuf(int width, int height)
// Zero-initialize the memory block (notice the parentheses).
: m_data(std::shared_ptr<unsigned int>(new unsigned int[width*height](),
Arra... | 4,418 | 1,601 |
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | 1,514 | 491 |
/// @copyright
/// Copyright (C) 2020 Assured Information Security, Inc.
///
/// @copyright
/// 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 limita... | 3,904 | 1,362 |
#define CATCH_CONFIG_MAIN
#include <iostream>
#include "catch.hpp"
class Solution {
public:
bool uniquestring(std::string s, int start, int end) {
for (int i = start; i < end; i++) {
for (int j = i + 1; j <= end; j++) {
if (s[i] == s[j]) {
return false;
}
}
}
return true;
}
int lengthOfLo... | 3,233 | 1,357 |
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | 4,161 | 1,330 |
/******************************************************************************
* Copyright 2019 Google
* 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/licens... | 10,584 | 3,916 |
#include "pch.hpp"
#include "Objbase.h"
#include "include/Error/Error.hpp"
#include "include/Guid/Guid.hpp"
namespace Boring32::Guid
{
// Adapted from https://stackoverflow.com/a/19941516/7448661
std::wstring GetGuidAsWString(const GUID& guid)
{
wchar_t rawGuid[64] = { 0 };
HRESULT result = StringFro... | 763 | 322 |
/*****************************************************************
*
* $Id: StTpcDbElectronics.cc,v 1.7 2008/08/02 14:33:09 fisyak Exp $
*
* Author: Manuel Calderon de la Barca Sanchez & Brian Lasiuk Sept 13, 1999
*
*****************************************************************
* Description: Electronics para... | 6,583 | 2,443 |
#include "../../src/countersignature.h"
#include <cstdint>
#include <cstring>
#include <gtest/gtest.h>
TEST(CountersignatureModule, countersignature_array_insert)
{
CountersignatureArray array;
array.counters = nullptr;
array.count = 0;
Countersignature countersig1 = {};
int res = countersignatu... | 1,586 | 655 |
#include <iostream>
#include <string.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem.hpp>
#include <sstream>
#include <algorithm>
#include <vector>
#include <stdlib.h>
#include <sstream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <chrono>
#include <sys/stat.h>
#... | 27,434 | 10,068 |
#include "pbrt/core/Film.hpp"
#include "pbrt/core/geometry/Utility.hpp"
#include "pbrt/memory/Memory.hpp"
namespace idragnev::pbrt {
Film::Film(const Point2i& resolution,
const Bounds2f& cropWindow,
std::unique_ptr<const Filter> filt,
Float diagonal,
cons... | 10,910 | 3,596 |
/*
* Copyright (C) 2022 Frank Mertens.
*
* Distribution and use is allowed under the terms of the zlib license
* (see cc/LICENSE-zlib).
*
*/
#include <cc/LogView>
#include <cc/Text>
#include <cc/LineSource>
#include <cc/Format>
namespace cc {
struct LogView::State final: public ListView::State
{
State()
... | 2,824 | 933 |
// Copyright 2019 The Fuchsia 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 "src/connectivity/wlan/drivers/third_party/broadcom/brcmfmac/pcie/pcie_bus.h"
#include <zircon/errors.h>
#include <algorithm>
#include <string>
#i... | 5,944 | 2,388 |
#include <fstream>
#include <algorithm>
#include <stdlib.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "json/json.h"
#include "json/reader.h"
#include "c9/loader.hpp"
#include "c9/script.hpp"
#include "c9/istream.hpp"
#include "c9/variable_frame.hpp"
#include "c9/cont... | 10,674 | 4,312 |
#pragma once
#include "L1_Peripheral/lpc17xx/pin.hpp"
#include "L1_Peripheral/lpc17xx/system_controller.hpp"
#include "L1_Peripheral/lpc40xx/i2c.hpp"
namespace sjsu
{
namespace lpc17xx
{
// Bring in and using the LPC40xx driver as it is compatible with the lpc17xx
// peripheral.
using ::sjsu::lpc40xx::I2c;
/// Struc... | 2,279 | 1,058 |
#include "offer.h"
unsigned int Offer::offerCounter = 0;
Offer::Offer(OfferType type, const std::string &symbol, unsigned int quantity, float price, unsigned int accountId)
{
this->offerId = ++offerCounter;
this->symbol_ = symbol;
this->quantity = quantity;
this->price = Offer::round(price);
this->accountId_ = ... | 477 | 185 |
#pragma once
#include <glm/glm.hpp>
namespace Quasar
{
class Camera
{
protected:
glm::mat4 m_Projection = glm::mat4(1.0f);
public:
Camera() = default;
Camera(const glm::mat4 &projection)
: m_Projection(projection)
{
}
virtual ~Camera()... | 435 | 149 |
/*
* Copyright (c) 2011, Willow Garage, Inc.
* 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 l... | 6,897 | 2,576 |
/**
* @file travelling-salesman-problem.cpp
* @author prakash (prakashsellathurai@gmail.com)
* @brief travelling-salesman-problem using branch and bound
* @version 0.1
* @date 2021-08-01
*
* @copyright Copyright (c) 2021
*
*/
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
usin... | 5,642 | 1,912 |
vector<int> Solution::intersect(const vector<int> &a, const vector<int> &b) {
int i = 0, j = 0;
vector<int>c;
int x = a.size();
int y = b.size();
while(i<x && j<y){
if(a[i]<b[j]){
i++;
}
else if(b[j]<a[i]){
j++;
}
else{
... | 421 | 165 |
#include "AnalogInput.h"
#include "Debug.h"
AnalogInput::AnalogInput(uint32_t instance, uint32_t channelGroup, adc16_chn_config_t channelConfig) :
mInstance(instance),
mChannelConfig(channelConfig),
mChannelGroup(channelGroup)
{
ADC16_DRV_ConfigConvChn(mInstance, mChannelGroup, &mChannelConfig);
}
uint16_t Analog... | 398 | 156 |
#include <vector>
class Solution {
public:
int currentDfn;
vector<vector<int>> answer;
void dfs(int start,
const vector<vector<int>>& graph,
vector<int>& dfn,
vector<int>& low,
int parent) {
for (const auto& v : graph[start]) {
if (v == parent) {... | 1,281 | 452 |
// Copyright 2021 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/page_load_metrics/browser/responsiveness_metrics_normalization.h"
#include "base/test/scoped_feature_list.h"
#include "components/pag... | 7,927 | 2,726 |
#ifndef _SCALECHANGEOBSERVER_HPP_
#define _SCALECHANGEOBSERVER_HPP_
/*
This class represents a C++ implementation of the DS-KCF Tracker [1]. In particular
the scaling system presented in [1] is implemented within this class
References:
[1] S. Hannuna, M. Camplani, J. Hall, M. Mirmehdi, D. Damen, T. Burghardt, A. ... | 1,400 | 442 |
/***************************************************************
* Name: ContainerFileTransitiveDataTarget.cpp
* Purpose: Code for Fu(X) 2.0
* Author: David Lecoconnier (david.lecoconnier@free.fr)
* Created: 2015-06-26
* Copyright: David Lecoconnier (http://www.getfux.fr)
* License:
*****************... | 1,879 | 547 |
/** MIT License
Copyright (c) 2017 Brandon Bluemner
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, ... | 1,734 | 683 |
// frame/object.hpp
//
// Copyright (c) 2007, 2008 Valentin Palade (vipalade @ gmail . com)
//
// This file is part of SolidFrame framework.
//
// 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.
//
#ifndef SOLID_FRAME_... | 3,555 | 1,348 |
#include "stdafx.h"
static int s_value = CALC_FIB1;
| 53 | 27 |
#include "pch.h"
#include "DllLoader.h"
using namespace MediaCodecRT;
HMODULE avutil_55_mod;
HMODULE avcodec_57_mod;
HMODULE avformat_57_mod;
HMODULE swscale_4_mod;
HMODULE swresample_2_mod;
HMODULE avdevice_57_mod;
HMODULE avfilter_6_mod;
HMODULE kernelAddr;
def_av_register_all * m_av_register_al... | 12,049 | 5,206 |
#include <iostream>
#include <math.h>
using namespace std;
class Vector3D{
private:
float x,y,z;
float a,b,c;
public:
Vector3D(float _x, float _y, float _z){
x = _x;
y = _y;
z = _z;
}
void getCoordinates(float &a, float &b, float &c){
a = x;
b = y;
c = z;
}
... | 2,947 | 1,242 |
#include "window.h"
#include "constants.h"
#include <ctime>
#include <SDL2/SDL_ttf.h>
bool Editor::Window::running = true;
SDLW::Window* Editor::Window::window;
SDLW::Renderer* Editor::Window::renderer;
Editor::Inputs Editor::Window::inputs;
Editor::Tool::Manager* Editor::Window::tool_manager;
std::string Editor::Wind... | 10,048 | 3,625 |
// bdlb_indexspanutil.t.cpp -*-C++-*-
#include <bdlb_indexspanutil.h>
#include <bdlb_indexspan.h>
#include <bslim_testutil.h>
#include <bsls_asserttest.h>
#include <bsls_buildtarget.h>
#include <bsl_cstdlib.h>
#include <bsl_cstring.h>
#include <bsl_iostream.h>
#include <bsl... | 13,725 | 4,310 |
#include <Arduino.h>
#include <string>
#include <Metro.h>
//#define DEBUG
#define LED_PIN 13
#define COMPUTER Serial
#define DUT Serial7
//Metro dutTimeout(100);
//Metro compTimeout(100);
Metro ledTimer(250);
bool ledEnable = false;
bool ledStatus = true;
#if defined(DEBUG)
void debugPrintout();
Metro d... | 1,601 | 631 |
// -------------------------------------------------------------------------------------
// Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved.
// For email, run on linux (perl v5.8.5):
// perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0... | 2,140 | 704 |
#include <Arduino.h>
#include <Ticker.h>
#define LOGGING_SERIAL
#include "Logger.h"
#include "WifiManager.h"
#include "BME280Sensor.h"
/*
#include <ESP8266WebServer.h>
#include <WiFiClient.h>
#include <ArduinoJson.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
//local
#include <OTAHandler.h>
#d... | 2,372 | 909 |
class Solution {
public:
bool threeConsecutiveOdds(vector<int>& arr) {
if(arr.size()<3) return false;
for(int i=0;i<arr.size()-2;i++){
if(arr[i]%2==1 && arr[i+1]%2==1 && arr[i+2]%2==1){
return true;
}
}
return false;
}
};
| 311 | 152 |
/*
Copyright (c) 2009-2016, Jack Poulson
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#include <El.hpp>
int
main( int argc, char* argv[] )
{
... | 1,652 | 549 |
#include <vector>
#include <cmath>
class Solution
{
public:
std::vector<int> constructRectangle(int area)
{
for (int i = std::sqrt(area); i >= 1; i--)
if (area % i == 0)
return {area / i, i};
return {};
}
}; | 264 | 91 |
#include <filesystem>
#include <iostream>
#include <vector>
#include <numeric>
#include <thread>
#include <exception>
#include <mz.h>
#include <mz_os.h>
#include <mz_strm.h>
#include <mz_strm_os.h>
#include <mz_zip.h>
#include <mz_zip_rw.h>
#include <tclap/CmdLine.h>
#include <indicators/progress_bar.hpp>
#include <con... | 6,251 | 2,211 |
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed W... | 2,542 | 1,009 |
#include "xmol/io/pdb/PdbRecord.h"
using namespace xmol::io::pdb;
std::map<RecordName,PdbRecordType> detail::get_bundled_records() {
auto as_field = [](const std::string& fieldName, std::vector<int> colons){
auto shortend = fieldName.substr(0,std::min(size_t(FieldName::max_length),fieldName.size()));
retur... | 16,426 | 7,101 |
#include "realvec_table_widget.h"
#include <QtAlgorithms>
#include <QKeyEvent>
#include <QApplication>
#include <QClipboard>
namespace MarsyasQt {
void RealvecTableWidget::keyPressEvent(QKeyEvent *event)
{
if (event == QKeySequence::Copy)
{
QModelIndexList selection = selectedIndexes();
qSort... | 672 | 201 |
#include <bits/stdc++.h>
using namespace std;
int solve(int n, vector<int> &a)
{
if (n == 1)
return 0;
bool asc = true;
int i;
for (i = n - 1; i > 0; i--)
{
if (asc && a[i] > a[i - 1])
asc = false;
else if (!asc && a[i] < a[i - 1])
break;
}
r... | 561 | 238 |
struct Queen {
int x;
int y;
};
bool hasHorizonalClash(const Queen& q1, const Queen& q2) {
return q1.y == q2.y;
}
bool hasVerticalClash(const Queen& q1, const Queen& q2) { return q1.x == q2.x; }
bool hasDiagonalClash(const Queen& q1, const Queen& q2) {
return (q1.x - q1.y) == (q1.x - q1.y) || (q1.x +... | 1,971 | 748 |
#include "common.h"
#include "block.h"
#include "builtin.h"
#include "compiler.h"
#include "dict.h"
#include "interp.h"
#include "input.h"
#include "list.h"
#include "module.h"
#include "string.h"
#include "sysexits.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#define Function Read... | 4,934 | 1,697 |
#include "list.h"
#include <fstream>
#include <string>
bool readFile(std::ifstream &file, List *list)
{
if (!file.is_open())
{
return false;
}
while (!file.eof())
{
std::string name;
std::string number;
getline(file, name);
getline(file, number);
add(list, name, number);
}
return true;
} | 312 | 135 |
#ifndef DISCRETE_SYSTEM_HPP
#define DISCRETE_SYSTEM_HPP
#include "model_common.hpp"
#include "model.hpp"
/* Information needed for the numerical simulation*/
typedef struct
{
int nb_eqs; // square system assumed
int nb_diff_eqs;
int nb_compl_eqs;
// TODO extended to double** (NumericsMatrix**) i... | 1,086 | 401 |
/*
* euriborcurve.hpp
* pybg
*
* Created by Bart Mosley on 7/2/12.
* Copyright 2012 BG Research LLC. All rights reserved.
*
*/
#ifndef EURIBORCURVE_HPP
#define EURIBORCURVE_HPP
#include <bg/curvebase.hpp>
#include <bg/date_utilities.hpp>
using namespace QuantLib;
namespace bondgeek {
class EURiborCur... | 1,086 | 378 |
/**
* RUNETag fiducial markers library
*
* -----------------------------------------------------------------------------
* The MIT License (MIT)
*
* Copyright (c) 2015 Filippo Bergamasco
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated docume... | 3,398 | 1,302 |
#include <string>
#include <utility>
#include <vector>
#include <memory>
#include <iostream>
#include <ssc/sscapi.h>
#include "SAM_api.h"
#include "ErrorHandler.h"
#include "SAM_Windpower.h"
SAM_EXPORT SAM_Windpower SAM_Windpower_construct(const char* def, SAM_error* err){
SAM_Windpower result = nullptr;
translate... | 24,965 | 10,430 |
#pragma once
#include <FishEngine/Serialization/Archive.hpp>
#include <set>
#include <vector>
#include <FishEngine/Prefab.hpp>
namespace FishEngine
{
class CollectObjectsArchive : public OutputArchive
{
public:
void Collect(Object* obj)
{
if (obj->Is<Prefab>())
return;
this->SerializeObject(obj);
}... | 5,853 | 2,080 |
#include<stdio.h>
int x, y;
int i, j;
char t;
char arr[100][100];
int prob[100][100];
void mine(){
if(i-1>=0 && j-1>=0) prob[i-1][j-1]++;
if(i-1>=0) prob[i-1][j]++;
if(i-1>=0 && j+1<y) prob[i-1][j+1]++;
///
if(j-1>=0) prob[i][j-1]++;
if(j+1<y) prob[i][j+1]++;
///
if(i+1<x && j-1>=0) pro... | 1,138 | 528 |
#include <iostream>
#include <fstream>
using namespace std;
void readName(string filename){
ifstream file;
file.open(filename, ios::in);
string line;
if (file.is_open())
{
while (getline(file, line))
{
cout << line << endl;
}
}
file.close();
}
clas... | 1,403 | 481 |
// Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma
// de Barcelona (UAB).
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
#include "CollisionStage.h"
namespace carla {
namespace traffic_manager {
namespace Collision... | 18,473 | 5,985 |
#pragma once
#include <cstdint>
#include <memory>
#include <tuple>
#include <vector>
#include <boost/range/adaptor/reversed.hpp>
#include <spdlog/spdlog.h>
namespace inexor {
/**
* Derived classes profits from automatic initialization and destruction
* of the sub components.
*/
class LifeCycleComponent
{
pr... | 2,633 | 735 |
//given an array.Arrange the elements st even nos. are at the begining and
//the odd nos. are the end
#include<iostream>
#include<vector>
using namespace std;
//moves the even and odd nums
void moveEvenOddNums(vector<int> &arr){
int i = 0; //this is for keeping track of even numbers
int j = arr.size()-1; //for kee... | 796 | 357 |
#include "synthesizer.hh"
#include <cmath>
#include <iostream>
constexpr unsigned int NUM_KEYS = 88;
constexpr unsigned int KEY_OFFSET = 21;
constexpr unsigned int KEY_DOWN = 144;
constexpr unsigned int KEY_UP = 128;
constexpr unsigned int SUSTAIN = 176;
using namespace std;
Synthesizer::Synthesizer( const string& ... | 3,886 | 1,483 |
#include <assert.h>
#include <drm_fourcc.h>
#include <fcntl.h>
#include <malloc.h>
#include <pthread.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/poll.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <... | 56,469 | 25,646 |
//******************************************************************************
//
// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LI... | 3,018 | 947 |
/**
* @file logger_test.cpp
* @author Mickael GAILLARD (mick.gaillard@gmail.com)
* @brief OpenWinch Project
*
* @copyright Copyright © 2020-2021
*/
#include "logger.hpp"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
class LoggerTest : public ::testing::Test {
protected:
Logger *logger = nullptr;
Logg... | 906 | 335 |
#include <iostream>
#include <string.h>
using namespace std;
class stack
{
int size;
int top;
char *sta;
char *str;
public:
stack(char *s)
{
str = s;
size = strlen(s);
top = -1;
sta = new char[size];
}
~stack()
{
delete []sta;
st... | 1,061 | 381 |
//
// Created by mhl on 19.10.16.
//
#include "Display.h"
#include <string>
#include <iostream>
#include <SDL2/SDL_ttf.h>
Display::Display()
: m_window(nullptr), m_surface(nullptr) {
}
bool Display::init(const std::string &title, int width, int height) {
if( SDL_Init( SDL_INIT_VIDEO) < 0 ) {
std::c... | 1,532 | 580 |
#pragma once
#include <cassert>
#include <chrono>
#include <memory>
#include <vector>
#include <actor-zeta.hpp>
#include <actor-zeta/detail/memory_resource.hpp>
#include "tooltestsuites/scheduler_test.hpp"
#include "tooltestsuites/clock_test.hpp"
static std::atomic<uint64_t> alarm_counter{0};
using actor_zeta::det... | 1,450 | 475 |
/*
* Copyright (C) 2021 FISCO BCOS.
* SPDX-License-Identifier: Apache-2.0
* 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
*
* Unl... | 2,185 | 718 |
// Generated by imageconverter. Please, do not edit!
#include <touchgfx/hal/Config.hpp>
LOCATION_EXTFLASH_PRAGMA
KEEP extern const unsigned char _st_menu_button_pressed[] LOCATION_EXTFLASH_ATTRIBUTE = { // 62x62 ARGB8888 pixels.
0x18,0x0c,0x00,0x00,0x18,0x0c,0x00,0x00,0x18,0x10,0x00,0x00,0x18,0x0c,0x00,0x00,0x18,0x10... | 77,409 | 66,189 |
// QueryStatus.cpp : implementation file
//
#include "stdafx.h"
#include "viewex.h"
#include "qstatus.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CQueryStatus dialog
... | 7,417 | 2,537 |
#include <bits/stdc++.h>
using namespace std;
// https://practice.geeksforgeeks.org/problems/range-minimum-query/1/
// Range Minimum Query
// Not completed
class SegmentTree{
private:
int n, t[4*10000];
map <string, int> rmq;
public:
SegmentTree( int * arr, int sz){
n = sz;
build(arr, 1, 0, n-1);
... | 1,376 | 614 |
/*AUTHOR: Landon M. Brown
*ASSIGNMENT TITLE: homework_03
*ASSIGNMENT DESCRIPTION: Edit the ListStack and main so that the
* overloaded constructor is used instead of the default one.
*DUE DATE: 10/15/2019
*DATE CREATED: 10/12/2019
*DATE LAST MODIFIED: 10/12/2019
*/
#include <iostream>
#include <fstream>
#include ... | 1,647 | 506 |
// Copyright (c) 2018-2019, Zhirnov Andrey. For more information see 'LICENSE'
#include "VCmdBatch.h"
#include "VFrameGraph.h"
namespace FG
{
/*
=================================================
constructor
=================================================
*/
VCmdBatch::VCmdBatch (VFrameGraph &fg, uint indexInPo... | 37,820 | 14,574 |
/*
Q-URL: https://leetcode-cn.com/problems/decode-string/
# BEATS 100%
*/
class Solution {
private:
string helper(string &s, string::iterator &it)
{
if (it == s.end()) return "";
string pre1, pre2, res, ens;
while (isalpha(*it)) pre1 += *it++;
if (it =... | 939 | 309 |
// Author: Stancioiu Nicu Razvan
// Problem: http://uva.onlinejudge.org/external/102/10281.html
#include <string>
#include <iostream>
#include <sstream>
#include <cstdio>
using namespace std;
int main()
{
int speed,currentSpeed=0;
int hour,min,sec;
int currentHour=0;
int prevHour=0;
string s;
double km=0;
whil... | 973 | 531 |
#include "pch.h"
#include "RavenTestDriver.h"
#include "raven_test_definitions.h"
#include "DocumentSession.h"
#include "AdvancedSessionOperations.h"
#include "RequestExecutor.h"
#include "User.h"
#include "PutDocumentCommand.h"
namespace ravendb::client::tests::client::documents::commands
{
class PutDocumentCommandT... | 2,089 | 787 |
// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved
// (DO NOT EDIT: machine generated header) 'ComServ.pas' rev: 5.00
#ifndef ComServHPP
#define ComServHPP
#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ComObj.hpp> // Pascal unit
#... | 3,375 | 1,043 |