text string | size int64 | token_count int64 |
|---|---|---|
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <string>
#include <stout/json.hpp>
#include <stout/stringify.hpp>
using std::string;
TEST(JsonTest, BinaryData)
{
JSON::String s(string("\"\\/\b\f\n\r\t\x00\x19 !#[]\x7F\xFF", 17));
EXPECT_EQ("\"\\\"\\\\\\/\\b\\f\\n\\r\\t\\u0000\\u0019 !#[]\\u007F\\u... | 702 | 340 |
// gameconstants.cc
// Bitwise functions for some of the various enums
// Teemu Mäkinen <culkah@gmail.com> 2014
#include "gameconstants.h"
| 141 | 54 |
/****************************************************************************
* Copyright (c) 2019, CEA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retai... | 37,161 | 13,190 |
/*
* Copyright 2021 Niket Naidu. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | 1,544 | 471 |
#include "Stdafx.h"
#include "GameObject/GameObject.h"
#include "Core/GameScene.h"
using namespace Phoenix;
FGameObject::FGameObject()
{
}
FGameObject::FGameObject(FGameScene& inGameScene, ID inId) :
Id(inId),
GameScene(&inGameScene)
{
}
FGameObject::~FGameObject()
{
}
void FGameObject::AddComponent(BaseComponen... | 1,063 | 351 |
#include <atcoder/all>
#include <iostream>
#include <random>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <math.h>
#include <unistd.h>
#include <unordered_set>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,s,n) for(in... | 779 | 372 |
// Copyright 2020-2022 The Defold Foundation
// Copyright 2014-2020 King
// Copyright 2009-2014 Ragnar Svensson, Christian Murray
// Licensed under the Defold License version 1.0 (the "License"); you may not use
// this file except in compliance with the License.
//
// You may obtain a copy of the License, together wi... | 3,738 | 1,296 |
#include "GUI.h"
#include <map>
#include <functional>
#include <string>
#include <set>
#define MAX_LOADSTRING 50
#define BORDER_MARGIN 50
#define BORDER_MARGIN_LEFT 150
#define BORDER_MARGIN_BOTTOM 100
#define BORDER_WIDTH 3
#define MARK_AXIS_SIZE 10
#define MARK_AXIS_TEXT_WIDTH 50
WCHAR szTitle[MAX_LOADSTRING] = L"... | 6,874 | 3,418 |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | 22,796 | 8,042 |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkQtView.cxx
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2009 Sandia Corp... | 1,622 | 384 |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) |
+---------... | 1,572 | 385 |
#include <dir2/file2.hpp>
#include <dir1/file1.hpp>
#include <iostream>
namespace Namespace2
{
void method()
{
Namespace1::method();
std::cout << "method - 2" << std::endl;
}
} // namespace Namespace2
| 213 | 82 |
// Copyright (C) 2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <ngraph/opsets/opset8.hpp>
#include <vector>
#include <memory>
namespace GNAPluginNS {
namespace ngraph_util {
template <typename T>
static bool get_constant_value(const std::shared_ptr<ngraph::opset8::Constant>&... | 2,469 | 752 |
/*
* Copyright Andrey Semashev 2007 - 2014.
* 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)
*/
/*!
* \file text_ostream_backend.hpp
* \author Andrey Semashev
* \date 22.04.2... | 3,578 | 1,223 |
/***********************************************************************************
* Basic bitext alignment algorithm implementations *
* *
* Authors: Philippe Ferreira De Sousa, Victoriya Kashtanova, Nad... | 3,164 | 1,295 |
// HashCon.cpp
#include "../../../Common/IntToString.h"
#include "ConsoleClose.h"
#include "HashCon.h"
static const wchar_t *kEmptyFileAlias = L"[Content]";
static const char *kScanningMessage = "Scanning";
static HRESULT CheckBreak2()
{
return NConsoleClose::TestBreakSignal() ? E_ABORT : S_OK;
}
HRESULT CHas... | 7,640 | 2,988 |
#pragma once
#include "compilation_pack.hh"
#include "refactor_adapter/files_keeper.hh"
#include "clang/Tooling/CommonOptionsParser.h"
#include <memory>
class FilesKeeperForRegressionTests : public FilesKeeper {
public:
FilesKeeperForRegressionTests(
CompilationPack *pack, std::shared_ptr<OptionsAdapter> opti... | 822 | 252 |
/*
* Copyright (c) 2003-2018, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of c... | 22,298 | 8,126 |
//===- LoopInterchange.cpp - Code to perform loop interchange --------------------===//
//
// Copyright 2019 The MLIR Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
/... | 3,691 | 1,267 |
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: EffectVariable.inl
// Content: D3DX11 Effects Variable reflection template
// These templates define the many Effect variable types.
//
///... | 163,903 | 55,584 |
//
// Copyright (c) 2008-2014 the Urho3D project.
//
// 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, mod... | 38,414 | 11,709 |
#include "stdafx.h"
// CGExchangeSynchLock.cpp
//
/////////////////////////////////////////////////////
#include "CGExchangeSynchLock.h"
BOOL CGExchangeSynchLock::Read( SocketInputStream& iStream )
{
__ENTER_FUNCTION
iStream.Read( (CHAR*)(&m_LockMyself), sizeof(BYTE));
return TRUE ;
__LEAVE_FUNCTI... | 763 | 265 |
#include "comm/SLIPMsgParser.hpp"
#include "crc.hpp"
using std::vector;
namespace comm {
SLIPMsgParser::SLIPMsgParser(unsigned int parseMsgMaxIn, unsigned int SLIPMaxLength) :
MsgParser(parseMsgMaxIn),
slipMsg(SLIPMsg(SLIPMaxLength))
{
};
unsigned int SLIPMsgParser::parseSerialMsg(co... | 1,565 | 540 |
#ifndef __cxxtest__GlobalFixture_cpp__
#define __cxxtest__GlobalFixture_cpp__
#include <cxxtest/GlobalFixture.h>
namespace CxxTest
{
bool GlobalFixture::setUpWorld() { return true; }
bool GlobalFixture::tearDownWorld() { return true; }
bool GlobalFixture::setUp() { return true; }
bool GlobalFixture::... | 897 | 284 |
#include <algorithm>
#include <iomanip>
#include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int a, b;
cin >> a >> b;
if (max(a, b) % min(a, b) == 0)
cout << "Sao Multiplos\n";
else
cout << "Nao sao Multiplos\n";
return 0;
}
| 314 | 124 |
template<typename T>
class AddSpace
{
private:
T const& ref; // refer to argument passed in constructor
public:
AddSpace(T const& r): ref(r) {
}
friend std::ostream& operator<< (std::ostream& os, AddSpace<T> s) {
return os << s.ref << ' '; // output passed argument and a space... | 439 | 142 |
/*=========================================================================
Program: ALBA (Agile Library for Biomedical Applications)
Module: albaPipeScalarMatrix
Authors: Paolo Quadrani
Copyright (c) BIC
All rights reserved. See Copyright.txt or
This software is distributed WITHOUT ANY WARRANTY; without eve... | 4,485 | 1,334 |
// File implement/oglplus/enums/texture_target_def.ipp
//
// Automatically generated file, DO NOT modify manually.
// Edit the source 'source/enums/oglplus/texture_target.txt'
// or the 'source/enums/make_enum.py' script instead.
//
// Copyright 2010-2019 Matus Chochlik.
// Distributed under the Boost Software Li... | 8,333 | 3,939 |
/****************************************************************************************
* @author: kzvd4729 created: 24-02-2018 21:46:36
* solution_verdict: Partially Accepted language: C++14
* run... | 1,407 | 472 |
#include "skinconfigchanger.hpp"
int KnifeCT = WEAPON_KNIFE_SKELETON;
int KnifeT = WEAPON_KNIFE_SKELETON;
int GloveCT = GLOVE_MOTORCYCLE;
int GloveT = GLOVE_MOTORCYCLE;
unordered_map<int, cSkin> cSkinchanger::Skins = unordered_map<int, cSkin>( {
//knife
make_pair(WEAPON_KNIFE, cSkin(59, -1, KnifeCT, -1, 3, nu... | 17,293 | 5,551 |
#include<stdio.h>
#include<stdlib.h>
int numcmp(const void *a,const void *b)
{
return *(int *)a-*(int *)b;
}
main()
{
scanf("%d",&n);
for(i=bsum=0;i<n;i++)
{
scanf("%d",&board[i]);
bsum+=board[i];
}
scanf("%d",&r);
for(i=rsum=0;i<r;i++)
{
scanf("%d",&j);
i... | 1,694 | 765 |
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
double alfa;
int alfa_slider = 0;
int alfa_slider_max = 100;
int top_slider = 0;
int top_slider_max = 100;
Mat image1, image2, blended;
Mat imageTop;
char TrackbarName[50];
void on_trackbar_blend(int, void*){
alfa = (doub... | 1,315 | 576 |
/*=========================================================================
*
* 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... | 3,593 | 1,165 |
/*
Copyright (c) 2014-2015 DataStax
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 writing... | 2,136 | 665 |
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "EventFilter/SiStripRawToDigi/test/plugins/SiStripFEDRawDataAnalyzer.h"
DEFINE_FWK_MODULE(SiStripFEDRawDataAnalyzer);
#include "EventFilter/SiStripRawToDigi/test/plugins/SiStripDigiAnalyzer.h"
DEFINE_F... | 966 | 394 |
/* render model module
part of uni module
Copyright 2020-2021 Lukas Cone
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
... | 3,600 | 1,185 |
/******************************************************************************
DSPatch - The Refreshingly Simple C++ Dataflow Framework
Copyright (c) 2020, Marcus Tomlinson
BSD 2-Clause License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following ... | 3,515 | 1,222 |
#include <iostream>
#include <math.h>
using namespace std;
int main(){
long long int n = 0, x;
cin >> n;
for(int i = 0; i < n; i++){
x = 0;
cin >> x;
x = ((pow(2, x)) / 12) / 1000;
cout << x << " kg" << endl;
}
return 0;
} | 283 | 125 |
#include <string>
#include <vector>
using namespace std;
string solution(int num)
{
string answer = "";
if (num % 2 == 0)
{
answer = "Even";
}
else
{
answer = "Odd";
}
return answer;
} | 236 | 86 |
// Copyright 2021 David Conran
/// @file
/// @brief Support for XMP protocols.
/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1414
/// @see http://www.hifi-remote.com/wiki/index.php/XMP
// Supports:
// Brand: Xfinity, Model: XR2 remote
// Brand: Xfinity, Model: XR11 remote
#include <algorithm... | 8,821 | 3,032 |
#ifndef DASH_REPLACER_HPP
#define DASH_REPLACER_HPP
#include <iostream>
#include <unordered_map>
#include "text/replacer/replacer.hpp"
/// Replaces -- with an en-dash and --- with an em-dash
class DashReplacer : public Replacer
{
public:
/// Constructs a new dash replacer
DashReplacer(const ReplacerTable* pT... | 889 | 267 |
/*
* An application for applying a Gaussian blur.
* It uses a 3x3 stencil with constant weights.
*/
#include "Halide.h"
namespace {
using namespace Halide;
// Size of blur for gradients.
const int blockSize = 3;
int imgSize = 64-blockSize+1;
class GaussianBlur : public Halide::Generator<GaussianBlur> {
public:
... | 4,730 | 1,809 |
#include "robotoc/utils/derivative_checker.hpp"
#include "robotoc/ocp/split_kkt_residual.hpp"
#include "robotoc/ocp/split_kkt_matrix.hpp"
#include "robotoc/ocp/split_solution.hpp"
#include "robotoc/hybrid/grid_info.hpp"
#include <cmath>
namespace robotoc {
DerivativeChecker::DerivativeChecker(const Robot& robot,
... | 19,074 | 7,859 |
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2015 - ROLI Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these ... | 7,479 | 1,996 |
/*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/
#include<bits/stdc++.h>
using namespace std;
int priority_ind[16][16], dp[1<<16], n;
int Set(int n, int pos)
{
return n|(1<<pos);
}
bool check(int n, int pos)
{
return (bool)(n & (1<<pos));
}
int counting(int m)
{
int cou... | 1,149 | 489 |
/*
* Copyright (c) 2019-2020, NVIDIA 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://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | 6,002 | 1,927 |
/**
* Provides the ImageHandler class used by the AssetManager to manage all
* sf::Image assets for the application.
*
* @file src/GQE/Core/assets/ImageHandler.cpp
* @author Ryan Lindeman
* @date 20120428 - Initial Release
*/
#include <GQE/Core/assets/ImageHandler.hpp>
#include <GQE/Core/loggers/Log_... | 4,553 | 1,486 |
// This file is part of CxxDoc, The RAVL C++ Documentation tool
// Copyright (C) 2001, University of Surrey
// This code may be redistributed under the terms of the GNU General
// Public License (GPL). See the gpl.licence file for details or
// see http://www.gnu.org/copyleft/gpl.html
// file-header-ends-here
#ifndef... | 5,225 | 1,732 |
////////////////////////////////////////////////////////////////////////////
// SQL Database MMF Extension
// (c) 2004-2005, Jim St. Jean
//
// MAIN OBJECT EDIT ROUTINES - Source file
//
//
////////////////////////////////////////////////////////////////////////////
//
// Originally generated using FireMonkeySDK
/... | 17,941 | 6,638 |
#include <chrono>
#include "envoy/common/scope_tracker.h"
#include "envoy/event/timer.h"
#include "common/event/dispatcher_impl.h"
#include "common/event/scaled_range_timer_manager_impl.h"
#include "test/mocks/common.h"
#include "test/mocks/event/wrapped_dispatcher.h"
#include "test/test_common/simulated_time_system... | 26,915 | 8,999 |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include <pch.h>
#include "winget/Yaml.h"
#include "YamlWrapper.h"
#include "AppInstallerErrors.h"
#include "AppInstallerLogging.h"
#include "AppInstallerStrings.h"
namespace AppInstaller::YAML
{
using namespace std::string_vie... | 13,501 | 4,174 |
#pragma once
#include "Location.hpp"
class Unit
{
int _damage,
_maxHP,
_currentHP,
_range,
_moveCooldown,
_weaponCooldown,
_lastMove,
_lastAttack;
public:
Unit()
: _damage(0)
, _maxHP(0)
, _currentHP(0)
, _range(0)
, _moveCooldown(0)
, _weaponCooldow... | 1,175 | 506 |
/*===================== begin_copyright_notice ==================================
Copyright (c) 2017 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, includi... | 268,914 | 87,583 |
// ==========================================================================
// Munin Scroll Pane
//
// Copyright (C) 2011 Matthew Chaplain, All Rights Reserved.
//
// Permission to reproduce, distribute, perform, display, and to prepare
// derivitive works from this file under the following conditions:
//
// ... | 13,683 | 3,822 |
/**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "Output.h"
#include <cassert>
#... | 13,417 | 3,973 |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2008-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (ge... | 8,753 | 2,832 |
#include "Mapper001.h"
Mapper001::Mapper001(int mapperNumber, int prgChunks, int chrChunks, std::vector<uint8_t>& prg, std::vector<uint8_t>& chr) :
Mapper(mapperNumber, prgChunks, chrChunks, prg, chr)
{
sramSize = 0x2000;
sram.resize(sramSize);
Reset();
}
Mapper001::Mapper001(Savestate& state, std::vector<uint8_t... | 3,382 | 1,805 |
//==============================================================================
// Copyright 2003 & onward LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 & onward LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// ... | 2,238 | 785 |
#include <iostream>
#include <numeric>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
class Rational {
public:
Rational() {
numerator = 0;
denominator = 1;
}
Rational(int numerator, int denominator)
{
if (denominator == 0)
{
th... | 3,548 | 1,226 |
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: google/devtools/cloudtrace/v1/trace.proto
#include "google/devtools/cloudtrace/v1/trace.pb.h"
#include "google/devtools/cloudtrace/v1/trace.grpc.pb.h"
#include <grpcpp/impl/codegen/async_stream.h>
#include <grpcpp/impl... | 7,476 | 2,419 |
/****************************************************************************
*
* Copyright (C) 2012, 2013 PX4 Development Team. All rights reserved.
* Author: Randy Mackay <rmackay9@yahoo.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that t... | 54,305 | 25,325 |
#include <catch/catch.hpp>
#include "utils.h"
#include <util/func.h>
namespace tests {
TEST_CASE("Test eigen vectorization", "[worker]") {
cleanSystem();
message::Message msg = util::messageFactory("demo", "eigen_vec");
execFunction(msg);
}
} | 277 | 89 |
#include "DigiKeyboard.h"
#define PIN_BUTTON 1
#define KEY_ESC 41
void setup() {
} // setup()
void loop() {
while ( digitalRead(PIN_BUTTON) == 0 ) {
DigiKeyboard.delay(10);
}
DigiKeyboard.update();
DigiKeyboard.sendKeyPress(KEY_ESC,0);
DigiKeyboard.delay(200);
DigiKeyboard.sendKeyPress(0,0... | 451 | 232 |
/*=============================================================================
Spirit v1.6.0
Copyright (c) 2001-2003 Joel de Guzman
http://spirit.sourceforge.net/
Permission to copy, use, modify, sell and distribute this software is
granted provided this copyright notice appears in all copie... | 7,295 | 1,972 |
// Copyright (c) 2020 ETH Zurich
//
// SPDX-License-Identifier: BSL-1.0
// 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)
#pragma once
#include <pika/config.hpp>
#include <pika/functional/function.hpp>
namespac... | 730 | 245 |
/* +------------------------------------------------------------------------+
| Mobile Robot Programming Toolkit (MRPT) |
| https://www.mrpt.org/ |
| |
| Cop... | 1,312 | 438 |
/*----------------------------------------------------------------------------/
Lovyan GFX - Graphics library for embedded devices.
Original Source:
https://github.com/lovyan03/LovyanGFX/
Licence:
[FreeBSD](https://github.com/lovyan03/LovyanGFX/blob/master/license.txt)
Author:
[lovyan03](https://twitter.com/lov... | 2,879 | 1,151 |
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "transformations/convert_subtract.hpp"
#include <memory>
#include <vector>
#include <ngraph/opsets/opset1.hpp>
void ngraph::pass::ConvertSubtract::convert_subtract() {
auto input0 = std::make_shared<pattern::op::Labe... | 1,360 | 485 |
#pragma once
#include <SFML/Graphics.hpp>
#include "global_defines.hpp"
#include "game_entity.hpp"
#include "utils.hpp"
/**
* @brief Class for the Entity representing the HUD
*/
class HUD : public GameEntity {
private:
protected:
public:
/**
* @brief Create the HUD Entity
*
*... | 1,346 | 477 |
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <memory>
#include <transformations_visibility.hpp>
#include <ngraph/function.hpp>
#include <ngraph/op/op.hpp>
#include <ngraph/rt_info.hpp>
#include <ngraph/pass/manager.hpp>
#include "snippets/generator.hpp... | 5,484 | 2,326 |
#include<iostream>
#include"Point.h"
using namespace std;
/**
* @file : PointCloudTEST.cpp
* @Author : Muzaffer Arda Uslu (usluarda58@gmail.com)
* @date : 12 Aralik 2019, Persembe
* @brief : Bu kod parcacigi olusturulan Point sinifinin dogru calisip calismadigini kontrol etmek amaciyla yazilmistir.
*/
int main() {
... | 792 | 393 |
// Generated by imageconverter. Please, do not edit!
#include <touchgfx/hal/Config.hpp>
LOCATION_EXTFLASH_PRAGMA
KEEP extern const unsigned char _toggle_off[] LOCATION_EXTFLASH_ATTRIBUTE = { // 90x70 ARGB8888 pixels.
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0... | 126,677 | 108,460 |
/*
如果引用了iostream或者vector,又加了using namespace std;这条语句,就尽量不要使用hash这样的变量名
因为这样会跟std命名空间里面的hash变量名冲突,导致编译失败或者运行出错
这种情况解决办法要么单独用std,比如std::cin、std::endl,要么直接避开hash作为变量名(可以改用HashTable)
类似的还有math.h的y1变量名,如果将其作为全局变量,就会导致编译错误
若编译有报错或者运行莫名出错,则可以考虑这些因素
*/
| 245 | 226 |
#include "main.h"
#include "alarm.h"
#include "file.h"
#include <stdio.h>
#include <string.h>
static void
print_help()
{
fputs("Usage: alarm set [DATE] [TIME] [OPTIONS]\n\n"
"Sets an alarm at the given time.\n\n"
"If --help or --version (or their short versions) are used as\n"
"options, only the first one w... | 2,240 | 920 |
#include <assert.h>
#include <stdio.h>
#include <cilk/cilk.h>
#include "test.h"
int global;
int test1(char *arr) {
int *x = (int *) &arr[2];
*x = 3;
return 0;
}
int test2(char *arr) {
int *x = (int *) &arr[0];
global = *x;
return 0;
}
int main(void) {
char arr[8] = {'0', '1', '0', '0', '0', '1',... | 480 | 242 |
#include<iostream>
//array implementation of Queue-we will use a circular array
using namespace std;
int main() {
return 0;
}
| 131 | 43 |
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* Created on: April 2022
* Author: Kira Duwe
*/
#include <chrono>
#include <ios> //std::ios_base::failure
#include <iostream> //std::cout
#include <stdexcept> //std::invalid_arg... | 3,503 | 1,339 |
#if defined(__linux__)
/*
* Copyright (c) 2014 Craig Lilley <cralilley@gmail.com>
* This software is made available under the terms of the MIT licence.
* A copy of the licence can be obtained from:
* http://opensource.org/licenses/MIT
*/
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#includ... | 7,362 | 2,529 |
// This file is auto-generated. Do not edit!
#include "precomp.hpp"
#include "opencl_kernels_calib3d.hpp"
#ifdef HAVE_OPENCL
namespace cv
{
namespace ocl
{
namespace calib3d
{
const struct ProgramEntry stereobm={"stereobm",
"#define MAX_VAL 32767\n"
"#ifndef WSZ\n"
"#define WSZ 2\n"
"#endif\n"
"#define WSZ2 ... | 8,650 | 4,259 |
#include "Gamepad.h"
namespace Lib830 {
Gamepad::Gamepad(int port):
joystick(port)
{
button_state.resize(joystick.GetButtonCount());
axis_state.resize(joystick.GetAxisCount());
pov_state.resize(joystick.GetPOVCount());
}
Gamepad::~Gamepad() {
}
bool Gamepad::ButtonState(int button) {
return joystic... | 1,497 | 683 |
/**
* Copyright (c) 2006-2020 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* ... | 4,261 | 1,627 |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | 29,730 | 9,462 |
/*
* Copyright (C) 2013-2014, The OpenFlint Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | 8,766 | 3,581 |
// Copyright 2021 RobosoftAI 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 agreed to... | 1,534 | 474 |
#include "R3D/RigidBodyEngine/BVHNode.h"
#include "R3D/RigidBodyEngine/BoundingSphere.h"
#include "R3D/RigidBodyEngine/BoundingBox.h"
#include "R3D/RigidBodyEngine/RigidBody.h"
namespace r3
{
namespace
{
template<class T>
class has_overlap_method
{
template<typename U, bool (U::*)(const U*) const> struct ch... | 5,147 | 2,102 |
/* Copyright (c) 2015 Diego Ongaro
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ... | 17,031 | 4,744 |
#include <utt/Configuration.h>
#include <utt/Coin.h>
#include <utt/RegAuth.h>
#include <utt/Tx.h>
#include <utt/Wallet.h>
#include <utt/Serialization.h> // WARNING: Must include last
std::ostream& operator<<(std::ostream& out, const libutt::Wallet& w) {
out << w.p;
out << w.ask;
out << w.rpk;
out << ... | 3,499 | 1,207 |
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "../src/UniversalIdentifier.hpp"
#include "mocks.h"
#include "helpers.h"
namespace
{
using namespace xmreg;
//string addr_56Vbjcz {"56VbjczrFCVZiLn66S3Qzv8QfmtcwkdXgM5cWGsXAPxoQeMQ79md51PLPCijvzk1iHbuHi91pws5B7iajTX9KTtJ4Z6HAo6"};
//string viewkey_56Vbjc... | 102,980 | 92,983 |
// boost thread_clock.cpp -----------------------------------------------------------//
// Copyright Beman Dawes 1994, 2006, 2008
// Copyright Vicente J. Botet Escriba 2009-2011
// Copyright Christopher Brown 2013
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/... | 3,482 | 1,150 |
#include <catch.hpp>
#include <filesystem>
#include <set>
#include <pddl/AST.h>
#include <pddl/Parse.h>
namespace fs = std::filesystem;
const pddl::Context::WarningCallback ignoreWarnings = [](const auto &, const auto &){};
const auto pddlInstanceBasePath = fs::path("data") / "pddl-instances";
const std::set<std::... | 8,253 | 3,159 |
/*++
Copyright (c) Microsoft Corporation All Rights Reserved
Module Name:
hw.cpp
Abstract:
Implementation of Base Audio Driver HW class.
Base Audio Driver HW has an array for storing mixer and volume settings
for the topology.
--*/
#include "definitions.h"
#include "hw.h"
//=====================... | 7,368 | 2,402 |
//===--- SwiftRemoteMirror.cpp - C wrapper for Reflection API -------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | 23,023 | 7,037 |
// -*- C++ -*-
// Copyright 2006-2007 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz
// or its licensors, as applicable.
//
// You may not use this file except under the terms of the accompanying license.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you
// may not use this file excep... | 4,401 | 1,483 |
#include "core.h"
#include "eldritchmusic.h"
#include "isoundinstance.h"
#include "eldritchframework.h"
EldritchMusic::EldritchMusic()
: m_MusicInstance( NULL )
{
IAudioSystem* const pAudioSystem = EldritchFramework::GetInstance()->GetAudioSystem();
ASSERT( pAudioSystem );
SInstanceDeleteCallback Callback;
Callba... | 1,713 | 599 |
/*
* SoX native format demuxer
* Copyright (c) 2009 Daniel Verkamp <daniel@drv.nu>
*
* Based on libSoX sox-fmt.c
* Copyright (c) 2008 robs@users.sourceforge.net
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Pu... | 5,004 | 1,860 |
#ifndef SIMPLE_WEB_CLIENT_WS_HPP
#define SIMPLE_WEB_CLIENT_WS_HPP
#include "asio_compatibility.hpp"
#include "crypto.hpp"
#include "mutex.hpp"
#include "utility.hpp"
#include <array>
#include <atomic>
#include <iostream>
#include <limits>
#include <list>
#include <random>
namespace SimpleWeb {
template <class socke... | 31,039 | 9,132 |
// Copyright (c) 2010, Google 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 list of conditi... | 49,718 | 16,448 |
#ifndef MYSORT_HPP
#define MYSORT_HPP
template<typename T>
void _swap(T& a, T& b) {
T temp = a;
a = b;
b = temp;
}
template<typename T>
void _quick_sort(T* items, int l, int r) {
if (r <= l)
return;
int m = (l + r) / 2;
if (items[m] < items[l])
_swap(items[m], items[l]);
if (items[r] < items[m])
_swap(i... | 966 | 455 |
#include "TexturesManager.h"
TexturesManager::TexturesManager()
{
_logger = Logger::GetInstance();
}
void TexturesManager::LoadFromFile(const std::string& name, const std::string& path, const sf::IntRect& area)
{
std::string message = " graphics No" + std::to_string(_textures.size() + 1) + " (" + name + ") from \""... | 4,049 | 1,510 |
//
// George O'Neill, University of York 2020
//
// Make a basic cube that allows for addition of photonic objects
//
// This defines histograms we are filling
//
#ifndef HistoManager_h
#define HistoManager_h 1
#define VERBOSE 1
#include <g4root.hh> // change this for different types of files
#include <G4UnitsTable.h... | 658 | 238 |