text string | size int64 | token_count int64 |
|---|---|---|
/**@file
* This file is part of the CANopen Library Unit Test Suite.
*
* @copyright 2020 N7 Space Sp. z o.o.
*
* Unit Test Suite was developed under a programme of,
* and funded by, the European Space Agency.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file exc... | 26,287 | 12,196 |
// Copyright 2017 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/storage/blobfs/blob.h"
#include <assert.h>
#include <ctype.h>
#include <fidl/fuchsia.io/cpp/wire.h>
#include <fuchsia/device/c/fidl.h>
#incl... | 49,825 | 16,932 |
/*
* This file is part of ACADO Toolkit.
*
* ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
* Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
* Milan Vukov, Rien Quirynen, KU Leuven.
* Developed within the Optimization in Engineering Center (OPTEC)
* u... | 3,654 | 1,055 |
//@time complexity O(1)
//@space complexity O(1)
//@result 1108 / 1108 test cases passed. Status: Accepted Runtime: 8 ms Submitted: 0 minutes ago You are here! Your runtime beats 7.51% of cpp submissions.
class Solution {
public:
bool isPowerOfTwo(int n) {
return n > 0 && ! (n & (n - 1));
}
};
| 312 | 118 |
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "extern/beatsaber-hook/shared/utils/typedefs.h"
#include "extern/beatsaber-hook/shared/utils/byref.hpp"
// Including type: System.IClonea... | 14,460 | 4,579 |
#include <napi.h>
#include "Samples/functionalexample.h"
#include "Samples/classexample.h"
Napi::Object InitAll(Napi::Env env, Napi::Object exports) {
functionalexample::Init(env, exports);
return ClassExample::Init(env, exports);
}
NODE_API_MODULE(NODE_GYP_MODULE_NAME, InitAll)
| 290 | 114 |
/*
*
* zad6.cpp
*
* Created on: Jan 15, 2020
* Author: eli
*/
#include <iostream>
using namespace std;
int main() {
int posl = 1;
int maxPosl = 1;
int digitOld;
int digitNew;
cin >> digitNew;
digitOld = -1;
while (digitNew != 0) {
if (digitOld == digitNew) {
posl++;
if (maxPosl < posl) {
... | 455 | 223 |
// Copyright 2015-2020 Piperift. All Rights Reserved.
#include "Multithreading/ScopedTaskManager.h"
| 101 | 40 |
#pragma once
#include "../Primitives2D/BatchRendererData.hpp"
#include "../../../Core/PointerTypes.hpp"
#include <Maths/Vectors/Vector2.hpp>
#include <Utility/Enum/kEnum.hpp>
#include <vector>
#include <cstdint>
namespace krakoa::gfx
{
class iTexture2D;
using TexCoordsList = std::vector<kmaths::Vector2f>;
ENUM_... | 1,823 | 705 |
#pragma once
#include <memory>
#include <string>
#include <reflex/function/callable_base.hpp>
#include <reflex/function/callable_with_instance.hpp>
#include <reflex/function/callable_without_instance.hpp>
#include <reflex/reflection_exception.hpp>
namespace reflex {
class function {
public:
struct functions_con... | 3,377 | 971 |
#include <hot_teacup/query.h>
#include <gtest/gtest.h>
TEST(Query, ToStringSingle)
{
auto query = http::Query{"foo", "bar"};
EXPECT_EQ(query.toString(), "foo=bar");
}
TEST(Query, ToString)
{
{
auto queries = http::Queries{{"name", "test"}, {"foo", "bar"}};
EXPECT_EQ(http::queriesToString(q... | 2,145 | 731 |
// Copyright (C) 2011-2020 Roki. Distributed under the MIT License
#ifndef INCLUDED_SROOK_TMPL_VT_REPLACE_HPP
#define INCLUDED_SROOK_TMPL_VT_REPLACE_HPP
#include <srook/tmpl/vt/detail/config.hpp>
SROOK_NESTED_NAMESPACE(srook, tmpl, vt) {
SROOK_INLINE_NAMESPACE(v1)
template <class T, class... Ts>
struct replace
... | 729 | 331 |
#include <Unknwn.h>
#include <Windows.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.UI.Xaml.Hosting.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <windows.ui.xaml.hosting.desktopwindowxamlsource.h>
#include "utils.h"
#include "flutter/ge... | 5,942 | 2,116 |
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or t... | 2,839 | 662 |
#include "zball.h"
ZBall::ZBall()
{
ZBall(0.0, 0.0, 0.0, 0.0);
}
ZBall::ZBall(double x, double y, double z, double r)
{
m_x = x;
m_y = y;
m_z = z;
m_r = r;
}
| 170 | 107 |
#include <iostream>
#include "Actor.h"
using namespace std;
Actor::Actor(const string aName, const string aBirthPlace,
const unsigned int aBirthYear) {
name = aName;
birthPlace = aBirthPlace;
birthYear = aBirthYear;
}
Actor::Actor(const Actor& actorToCopy) {
name = actorToCopy.getName();
birthPlace = actorTo... | 918 | 343 |
#ifndef VEC3_H
# define VEC3_H
/*
* vec3
* v 0.0.7
* 2020-2020
* Template Vec adapted from Rope Vector, Processing PVector, Openframework and GLSL.
*/
#include "vec2.hpp"
template <class T>
class vec3 : public vec2<T> {
private:
static int instance;
static bool _warning;
protected:
T _z;
public:
vec3();
vec3(T co... | 25,752 | 11,644 |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "cadran.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QGraphicsScene *scene = new QGraphicsScene(this);
ui->graphicsView->setScene(scene);
cadran * c = new cadran;
s... | 403 | 151 |
//
// Copyright (c) 2017 The nanoFramework project contributors
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
// See LICENSE file in the project root for full license information.
//
#include "nanoFramework_hardware_esp32_native.h"
static const CLR_RT_MethodHandler method_lookup[] =
{
NUL... | 2,374 | 872 |
/* A generated header file from setup.py */
#ifndef OBCSIM_CONFIGURATION_H
#define OBCSIM_CONFIGURATION_H
#include "msp_obc.h"
#define EXP_ADDR 0x35
#define EXP_MTU 507
#define REQUEST_BUFFER_SIZE 25000
#define MSP_ERROR_THRESHOLD 5
#ifndef MSP_OP_REQ_PAYLOAD
#define MSP_OP_REQ_PAYLOAD 0x20
#endif
#ifndef MSP_OP_AC... | 2,541 | 1,311 |
/*
* Copyright (C) 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | 2,628 | 904 |
#include <cpprest/filestream.h>
#include <cpprest/http_client.h>
#include <cpprest/json.h>
#include "../include/utils.hpp"
#include "../include/json_rpc.hpp"
using namespace std;
using namespace utility;
using namespace web;
using namespace web::http;
using namespace web::http::client;
namespace json_rpc
{
class... | 25,016 | 6,481 |
// -------------------------------------------------------------------------
// Donkey Kong Jr
// a Nintendo's Game & Watch adaptation on Gamebuino META
// -------------------------------------------------------------------------
// © 2019 Steph
// ... | 3,315 | 918 |
#include "shiguredo/mp4/box_type.hpp"
#include <fmt/core.h>
#include <algorithm>
#include <array>
#include <cctype>
#include <cstdint>
#include <iterator>
#include <regex>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
namespace shiguredo::mp4 {
BoxType::BoxType(const std::string& str) ... | 1,957 | 830 |
#include "dunesim_impl.hpp"
#include "duneconverter.hpp"
#include "dunegrid.hpp"
#include "logger.hpp"
namespace sme::simulate {
DuneImpl::DuneImpl(const simulate::DuneConverter &dc) {
for (const auto &ini : dc.getIniFiles()) {
std::stringstream ssIni(ini.toStdString());
auto &config = configs.emplace_back(... | 920 | 334 |
#include "box2d_joint.hpp"
#include "mocks/box2d_world_mock.hpp"
#include "mocks/mock_game.hpp"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
using namespace ::testing;
class Box2dJointTest : public ::testing::Test {
public:
std::shared_ptr<Box2DWorldMock> m_mockWorld;
void SetUp() override { m_mockWorl... | 1,676 | 674 |
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
int main() {
int N, ans = 0;
cin >> N;
for(int i = 0; i < N; i++) {
int P;
cin >> P;
int b = P / 10,
e = P % 10;
ans += pow(b, e);
}
cout << ans << endl;
return 0;
} | 316 | 153 |
/*=========================================================================
Library: TubeTK
Copyright 2010 Kitware Inc. 28 Corporate Drive,
Clifton Park, NY, 12065, USA.
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Lic... | 6,106 | 2,343 |
/*
* Copyright (C) 2015 University of Oregon
*
* You may distribute under the terms of either the GNU General Public
* License or the Apache License, as specified in the LICENSE file.
*
* For more information, see the LICENSE file.
*/
/* WaveformUtility.cpp */
#include <iostream>
#include <string.h>
#include <... | 7,914 | 2,882 |
// Copyright 2018-2019 Coen Tempelaars (Falcons)
// SPDX-License-Identifier: Apache-2.0
/*
* gameDataTest.cpp
*
* Created on: Dec 27, 2018
* Author: Coen Tempelaars
*/
#include <gtest/gtest.h>
#include "int/gameDataFactory.hpp"
class AGame : public ::testing::Test
{
public:
AGame()
{
gameD... | 1,221 | 547 |
<<<<<<< HEAD
#include "answer.h"
#include "global.h"
Answer::Answer()
{
}
void Answer::created(int id,int userId,QString content,QString createtime)
{
this->setId(id);
this->setUserId(userId);
this->setContent(content);
this->setTime(createtime);
}
int Answer::getPraisedNum()
{
return this->prai... | 4,312 | 1,708 |
/*
The MIT License
Copyright (c) 2013 Andreas Samoljuk
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, publ... | 11,899 | 6,459 |
#include "Looper.h"
LooperHandler::LooperHandler(){
_loopers = 0;
}
LooperHandler::~LooperHandler(){
LooperEntry *n, *e;
e = _loopers;
while (e->next){
n = e->next;
delete e;
e = n;
}
if (e) delete e;
_loopers = 0;
}
void LooperHandler::registerLooper(Looper *loop... | 567 | 221 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/lexv2-models/model/ExportSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
na... | 3,211 | 1,067 |
/*
* File created on 10/09/2021 at 14:56:58.
* Link to problem:
* Description:
* Time complexity: O()
* Space complexity: O()
* Status: DEV (most of the time I don't update status, so it stays DEV which is the default value)
* Copyright: Ⓒ 2021 Francois Vogel
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/as... | 2,017 | 878 |
/*
MIT License
Copyright (c) 2018 Cognitive Machines
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, publ... | 3,044 | 908 |
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Victor Cruceru wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can bu... | 1,274 | 383 |
/*=============================================================================
Copyright (c) 2001-2010 Joel de Guzman
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)
=========================================... | 3,170 | 892 |
#include "sustain.h"
#include "sustain.h"
#include "serial.h"
#include "settings.h"
#include "note.h"
SustainPedal sustain;
SustainPedal::SustainPedal()
{
//initialize one row of vectors so program won't crash while comparing
//initialize sustain as off by default
for(int index = 0; index < 4; index++)
{
schedu... | 4,095 | 1,677 |
#include "CinderStructure.h"
namespace Ember {
bool CinderStructure::Load(const std::string& file_path) {
core_file = new File(file_path.c_str());
bool inside_section = false;
bool reading_a_key = true;
size_t current_section = -1;
std::string save_key;
core_file->DoEachWord([&](std::string& word, unsign... | 4,922 | 2,072 |
// Generated from /POI/java/org/apache/poi/ss/formula/functions/Sumx2py2.java
#pragma once
#include <fwd-POI.hpp>
#include <org/apache/poi/ss/formula/functions/fwd-POI.hpp>
#include <java/lang/Object.hpp>
#include <org/apache/poi/ss/formula/functions/XYNumericFunction_Accumulator.hpp>
struct default_init_tag;
class... | 721 | 261 |
#include <boost/test/unit_test.hpp>
#include <graphene/chain/database.hpp>
#include <graphene/chain/exceptions.hpp>
#include <graphene/chain/hardfork.hpp>
#include <graphene/chain/account_object.hpp>
#include <graphene/chain/asset_object.hpp>
#include <graphene/chain/committee_member_object.hpp>
#include <graphene/ch... | 3,724 | 1,383 |
/*******************************************************************************
* Copyright 2020-2022 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://... | 8,633 | 2,823 |
/**
* Copyright 2021 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... | 3,564 | 1,261 |
#ifndef MANIFOLDS_FUNCTIONS_CONCEPTS_HH
#define MANIFOLDS_FUNCTIONS_CONCEPTS_HH
#include "variables.hh"
#include "composition.hh"
#include "addition.hh"
#include "multiplication.hh"
namespace manifolds {
template <class T> struct is_variable : std::false_type {};
template <int N, bool a, bool c>
struct is_variable<V... | 1,618 | 562 |
#include <stdexcept>
#include "SQLiteArchive.hpp"
#include "Util.hpp"
#include "SQLitePreparedStatementFactory.hpp"
#include "SQLiteRootDirectory.hpp"
#include "SQLiteDirectory.hpp"
#include "SQLiteFile.hpp"
#include "SQLitePath.hpp"
namespace SQLite {
void Archive::open(std::shared_ptr<SQLite::Database> db) {
mDB... | 1,523 | 578 |
//
// Created by discord on 24/02/17.
//
#include "Settings.hpp"
#define NO_SETTINGS_FAIL "cannot_find_setting"
/**
* Constructor
* @param p path to config file
*/
Settings::Settings(const std::string &p) : path(p)
{
parse();
}
void Settings::parse(void)
{
FILE* file = fopen(path.c_str(), "r");
if(fi... | 4,147 | 1,343 |
// (c) Aleksandr Shevchenko e-mail : Sasha7b9@tut.by
#include "defines.h"
#include "HAL.h"
#include "Interface.h"
#include "Keyboard.h"
#include "PowerSupply.h"
int main()
{
HAL::Init();
Keyboard::Init();
while (1)
{
Keyboard::Update();
KeyboardEvent event = Keyboard::Buffer::GetNex... | 447 | 164 |
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
==============================================================... | 5,604 | 2,034 |
#include "DX11_Triangle.h"
#include <vector>
#include <d3d11.h>
#include <dxgi1_2.h>
#include <d3dcompiler.h>
#include "Common/DX.Utils/DxException.h"
#include "Common/Math.Utils/Math.h"
#include "Common/Win.Utils/ExePath.h"
void DX11_Triangle::DrawTriangle(HWND hWnd, uint32_t windowWidth, uint32_t windowHeight)
{
... | 17,327 | 6,122 |
#include <xloil/AppObjects.h>
#include <xlOil-COM/Connect.h>
#include <xlOil-COM/ComVariant.h>
#include <xlOil/ExcelTypeLib.h>
#include <xlOil/ExcelRange.h>
#include <xloil/Log.h>
#include <xloil/Throw.h>
#include <xloil/State.h>
#include <functional>
#include <comdef.h>
using std::shared_ptr;
using std::make_shared;
... | 6,898 | 2,407 |
#include <cstdio>
#include <cstring>
#define STRING_LENGTH 100000
using namespace std;
struct sortinfo
{
int x, y, ord;
};
int l;
char s[STRING_LENGTH];
int rank[STRING_LENGTH * 2], sa[STRING_LENGTH];
void radix_sort(sortinfo *d)
{
static sortinfo _d[STRING_LENGTH], res[STRING_LENGTH];
static int c[STRING_LENGT... | 1,620 | 952 |
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
// -- BEGIN LICENSE BLOCK ----------------------------------------------
// -- END LICENSE BLOCK ------------------------------------------------
//----------------------------------------------------------------------
/*!\file
*
* \author ... | 4,912 | 1,932 |
#include "parser.h"
#include "util.h"
#include <cstdint>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <vector>
constexpr int MEMORY_SIZE = 30000;
void interpretor(const Program &p, bool verbose) {
std::vector<uint8_t> memory(MEMORY_SIZE, 0);
size_t pc = 0;
size_t dataptr = 0;
while (pc ... | 3,105 | 1,138 |
#include "../include/server_communicator.hpp"
#include <prep/include/prep.h>
#include <cstddef>
#include <string>
#include <utility>
#include <algorithm>
TMSOCKET_NAMESPACE_BEGIN
#include "details/protocol.ipp"
server_communicator::
server_communicator()
{
this->m_stm.on_reveive
(
[this] (tmsocket_t... | 2,257 | 848 |
// Copyright (c) 2012 Nezametdinov E. Ildus
// Licensed under the MIT License (see LICENSE.txt for details)
#include "ResourceFactory.h"
#include "ResourceManager.h"
namespace selene
{
ResourceFactory::ResourceFactory(FileManager* fileManager):
fileManager_(fileManager), resourceManager_(null... | 1,150 | 242 |
/*
* Copyright (c) 2017 - 2018, Intel Corporation
*
* 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,... | 4,853 | 1,481 |
#include <iostream>
#include <ios>
using std::cin;
int main()
{
std::ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t{0};
cin >> t;
for (int i{0}; i < t; ++i)
{
int die1[4], die2[4];
for (int j{0}; j < 4; ++j)
{
cin >> die1[j];
}
double prob2{0};
double prob1{0};
... | 2,563 | 928 |
/**
* @file llpanellandmarks.cpp
* @brief Landmarks tab for Side Bar "Places" panel
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of ... | 46,476 | 16,778 |
#include <ros/ros.h>
#include <math.h>
#include <iostream>
#include "boost/thread/mutex.hpp"
#include <LinearMath/btMatrix3x3.h>
#include <sensor_msgs/LaserScan.h>
#include <geometry_msgs/Twist.h>
#include <geometry_msgs/PoseStamped.h>
#include <visualization_msgs/Marker.h>
#include <tf/transform_listener.h>
#include ... | 7,254 | 2,806 |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// Derived class from CCeeGen which handles writing out
// the exe. All references to PEWriter pulled out of CCeeGen,
// and moved here
//
//
#include "stdafx.h"
#include <string.h>... | 48,944 | 16,827 |
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include "crypto/crypto_store/crypto_store_impl.hpp"
#include <gmock/gmock.h>
#include "crypto/bip39/impl/bip39_provider_impl.hpp"
#include "crypto/ed25519/ed25519_provider_impl.hpp"
#include "crypto/pbkdf2/impl/pbkd... | 13,797 | 5,328 |
#pragma once
/**
用于动态加载dll/so的包装类
用法示例:
class User32DLL {
public:
DYLIB_LOAD(User32DLL, "user32");
DYLIB_IMPORT(MessageBoxA);
DYLIB_IMPORT(MessageBoxW);
};
User32DLL user32;
user32.MessageBoxA(NULL, "Hello World", "test", MB_OK);
*/
#include <stdexcept>
#include <string>
#ifdef _WIN32
#include <... | 1,162 | 552 |
// 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 "third_party/blink/renderer/core/paint/cull_rect_updater.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/... | 7,045 | 2,745 |
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance w... | 55,677 | 15,800 |
#pragma once
// ARKSurvivalEvolved (329.9) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_ProjMekSiegeCannon_structs.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Classes
//------------------------------------------------------... | 1,770 | 589 |
// -*-Mode: C++;-*-
#ifndef DATAFRAGMENTUNPACK_HH
#define DATAFRAGMENTUNPACK_HH
/* ---------------------------------------------------------------------- *//*!
*
* @file DataFragment.hh
* @brief Access methods for the RCE data fragments
* decoding a binary test file.
* @verbatim
* ... | 4,737 | 1,135 |
//---------------------------------------------------------------------------
// Program: tic tac toe cli
// Name: Bango
// Purpose: This will be an implementation of a tic-tac-toe game.
// This is a 2 player version of tic-tac-toe where 'X' goes first
// followed by 'O'. When it is player 1's... | 8,764 | 2,895 |
#include <iostream>
#include <gpgpu/Context.hpp>
#include <gpgpu/Framebuffer.hpp>
#include <gpgpu/Program.hpp>
#include <OpenImageIO/imagebufalgo.h>
using namespace std;
int main() {
/*
* Context
*/
gpgpu::Context context;
cout << context << endl;
/*
* Shader
*/
gpgpu::Progr... | 1,967 | 734 |
// Copyright 2020 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 "i2c-child.h"
#include <lib/fake_ddk/fake_ddk.h>
#include <ddk/binding.h>
#include <zxtest/zxtest.h>
#include "i2c-bus.h"
namespace i2c {
con... | 11,745 | 4,555 |
#include "os/c-api/il2cpp-config-platforms.h"
#if !IL2CPP_DOTS_WITHOUT_DEBUGGER
#include "os/Path.h"
#include "utils/PathUtils.h"
#include "Allocator.h"
extern "C"
{
const char* UnityPalGetTempPath()
{
return Allocator::CopyToAllocatedStringBuffer(il2cpp::os::Path::GetTempPath());
}
const ch... | 1,192 | 395 |
//
// Author: Alexander Sholohov <ra9yer@yahoo.com>
//
// License: MIT
//
#include <memory.h>
#include "buffer.h"
//---------------------------------------------------------------------------------------------------
CBuffer::CBuffer(size_t bufferSize)
{
m_buffer.resize(bufferSize + 16);
m_head = 0;
m_tai... | 2,715 | 849 |
/*
cppcryptfs : user-mode cryptographic virtual overlay filesystem.
Copyright (C) 2016-2020 Bailey Brown (github.com/bailey27/cppcryptfs)
cppcryptfs is based on the design of gocryptfs (github.com/rfjakob/gocryptfs)
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining... | 23,629 | 10,630 |
#include <stdio.h>
#include <stdlib.h>
#include "vpi_user.h"
#include "Thread.h"
#include "veri_memory_macros.h"
#include "veri_memory.h"
#include "global_vars.h"
#include "VPI_global_vars.h"
int copyMemory_calltf(char *user_data)
{
vpiHandle systf_handle, arg_iterator, arg_handle, reg_handle;
s_vpi_value current... | 1,203 | 485 |
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#define _SCL_SECURE_NO_WARNINGS
#include <AzTest/AzTest.h>
#include <AzCore/std/createdestroy.h>... | 28,511 | 7,135 |
//--------------------------------------------------------------------------------------------------
// Copyright (c) Yugabyte, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// ht... | 5,584 | 1,725 |
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
=============================================================================*/
#include "MobileReflectionEnvironmentCapture.h"
#include "ReflectionEnvironmentCapture.h"
#inclu... | 16,663 | 6,541 |
#include "Color.h"
#include "Graphics.h"
namespace Altseed2 {
Color::Color() : A(TextureDefaultColor), R(TextureDefaultColor), G(TextureDefaultColor), B(TextureDefaultColor) {}
Color::Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) : A(a), R(r), G(g), B(b) {}
Color Color::operator*(const Color& right) {
retur... | 1,030 | 356 |
class BoolString {
private:
std::string value;
public:
BoolString (std::string const& s)
: value(s) {
}
template<typename T = std::string>
T get() const { // get value (converted to T)
return value;
}
};
| 251 | 82 |
#ifndef GAME_HPP_INCLUDED
#define GAME_HPP_INCLUDED
#include <SFML/Graphics.hpp>
class Game{
public:
static void Start();
private:
static sf::RenderWindow app;
sf::View view1;
};
#endif // GAME_HPP_INCLUDED
| 213 | 91 |
// MIT License
//
// Copyright (c) 2018 Benjamin Kiesl
//
// 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, modi... | 3,495 | 1,157 |
#include <aws/core/Aws.h>
#include "Tensorizer.h"
#include <chrono>
using namespace mx::contrib;
int main(int argc, char **argv) {
Aws::SDKOptions options;
options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options);
Tensorizer nd_array_fetcher;
// const std::string bucke... | 1,067 | 400 |
#include "dot.hpp"
namespace tblis
{
namespace internal
{
template <typename T>
void dot(const communicator& comm, const config& cfg, len_type m, len_type n,
bool conj_A, const T* A, stride_type rs_A, stride_type cs_A,
bool conj_B, const T* B, stride_type rs_B, stride_type cs_B, T& result)
{
if ... | 1,368 | 528 |
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
typedef unsigned long long ul;
typedef long long ll;
using namespace std;
ll t, n;
int main(){
ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
cin >> t;
while(t--)
{
cin >> n;
ll a[n];
... | 868 | 308 |
#include "consume.h"
#include "max_unit_energy.h"
#include "../SCBW/api.h"
#include "../SCBW/scbwdata.h"
#include "../SCBW/enumerations.h"
/// Helper function: Sets death scores for [unit] owned by [player].
void incrementDeathScores(const CUnit *unit, u8 player);
/// Decides whether the given unit can be ... | 1,567 | 549 |
//
// Copyright 2020 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 ... | 3,872 | 1,278 |
#include "stdafx.h"
#include "GameTask.h"
#include "script_space.h"
#include <luabind/adopt_policy.hpp>
using namespace luabind;
#pragma optimize("s",on)
void CGameTask::script_register(lua_State *L)
{
module(L)
[
class_<enum_exporter<ETaskState> >("task")
.enum_("task_state")
[
valu... | 2,606 | 1,249 |
/*
By Rama
*/
#include "VictoryBPLibraryPrivatePCH.h"
#include "VictoryBPHTML.h"
#if PLATFORM_HTML5_BROWSER
#include "SDL_opengl.h"
DEFINE_LOG_CATEGORY_STATIC(VictoryPluginHTML, Log, All);
#include "emscripten.h"
#include "html5.h"
#endif
bool UVictoryBPHTML::IsHTML()
{
#if PLATFORM_HTML5_BROWSER
return tr... | 1,277 | 590 |
// Question Link ---> https://leetcode.com/problems/flood-fill/
// Day #25
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Solution {
public:
vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int newColor) {
// We need to consider starting pix... | 1,349 | 578 |
/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from PoseStamped_.idl using "rtiddsgen".
The rtiddsgen tool is part of the RTI Connext distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the RTI Connext manual.
*/
#ifndef NDDS_STANDALONE_TYPE
#ifn... | 9,632 | 2,769 |
#ifndef STAN_MATH_REV_CORE_OPERATOR_MULTIPLICATION_HPP
#define STAN_MATH_REV_CORE_OPERATOR_MULTIPLICATION_HPP
#include <stan/math/rev/core/var.hpp>
#include <stan/math/rev/core/vv_vari.hpp>
#include <stan/math/rev/core/vd_vari.hpp>
#include <stan/math/prim/scal/fun/is_any_nan.hpp>
#include <limits>
namespace stan {
n... | 3,191 | 1,245 |
#include <bits/stdc++.h>
using namespace std;
int main (){
double n[100];
for(int i = 0; i < 100; i++){
cin >> n[i];
if(n[i] <= 10){
printf("A[%d] = %.1lf\n", i, n[i]);
}
}
return 0;
} | 203 | 119 |
#ifndef AVRLIB_ADC_HPP
#define AVRLIB_ADC_HPP
#include <avr/io.h>
namespace avrlib {
enum adc_timer_mode
{
adc_prescaler_2 = 1,
adc_prescaler_4,
adc_prescaler_8,
adc_prescaler_16,
adc_prescaler_32,
adc_prescaler_64,
adc_prescaler_128
};
class sync_adc
{
public:
explicit sync_adc(uint8_t channel, bool re... | 2,725 | 1,376 |
/*
* Author : OFShare
* E-mail : OFShare@outlook.com
* Created Time : 2020-07-01 13:40:58 PM
* File Name : P2014.cc
*/
#include <bits/stdc++.h>
#define ll long long
void debug() {
#ifdef Acui
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
#endif
}
const int N = ... | 1,317 | 769 |
/*
* This file is part of liblcf. Copyright (c) 2018 liblcf authors.
* https://github.com/EasyRPG/liblcf - https://easyrpg.org
*
* liblcf is Free/Libre Open Source Software, released under the MIT License.
* For the full copyright and license information, please view the COPYING
* file that was distributed with t... | 3,001 | 1,061 |
// Copyright 2022 Peter Leontev. All Rights Reserved.
#include "ImageReaderLocal.h"
#include "HAL/FileManager.h"
#include "Misc/FileHelper.h"
#include "Stats/Stats.h"
bool FImageReaderLocal::ReadImage(const FString& ImageURI, TArray<uint8>& OutImageData)
{
QUICK_SCOPE_CYCLE_COUNTER(STAT_RuntimeImageUtils_ImportFi... | 1,439 | 502 |
#pragma once
#include <facter/facts/collection.hpp>
#include <facter/facts/value.hpp>
#include <string>
bool load_custom_fact(std::string const& filename, facter::facts::collection& facts);
std::string ruby_value_to_string(facter::facts::value const* value);
| 261 | 89 |
#ifndef GEAROENIX_RENDER_CAMERA_MANAGER_HPP
#define GEAROENIX_RENDER_CAMERA_MANAGER_HPP
#include "../../core/asset/gx-cr-asset-manager.hpp"
#include "../../core/cache/gx-cr-cache-file.hpp"
#include "../../core/sync/gx-cr-sync-end-caller.hpp"
#include "gx-rnd-cmr-camera.hpp"
namespace gearoenix {
namespace system::stre... | 1,460 | 506 |
/*------------------------------------------------------------------------
* (The MIT License)
*
* Copyright (c) 2008-2011 Rhomobile, Inc.
*
* 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 ... | 43,935 | 16,058 |
//------------------------------------------------------------------------------
// nesci -- neuronal simulator conan interface
//
// Copyright (c) 2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualization Group.
//------------------------------------------------------------------------------
/... | 1,824 | 556 |