text stringlengths 5 1.04M |
|---|
#include "pch.h"
#include "Game.h"
// base on the video "Let's make 16 games in C++: Arkanoid" by FamTrinli
// https://www.youtube.com/watch?v=U7vSIvLLZi0
//
int main() {
srand((unsigned int)time(0)); // seed random number generator
Game game;
game.run();
return EXIT_SUCCESS;
}
|
//==================================================================================================
/**
Copyright 2016 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
**/
//====================================... |
//
// LocalSearchBase.cpp
// GA
//
// Created by Tom den Ottelander on 07/01/2020.
// Copyright © 2020 Tom den Ottelander. All rights reserved.
//
#include "LocalSearchBase.hpp"
using namespace std;
LocalSearchBase::LocalSearchBase (FitnessFunction * fitFunc, Utility::Order localSearchOrder, float stochasticity,... |
//
// Created by Leonard Koll on 16.05.21.
//
#include "FlyData.h"
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
double EPS=1e-9;
int INF=1000000005;
long ... |
// Copyright 2021 Apex.AI, 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 i... |
#include "App.xaml.h"
#include "OpenGLESPage.xaml.h"
using namespace cocos2d;
App::App()
{
InitializeComponent();
}
void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
{
if (mPage == nullptr)
{
mPage = ref new OpenGLESPage(&mOpenGLES);
}
// Place the page in the current ... |
#include "DataFormats/ForwardDetId/interface/HFNoseDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCalDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "... |
//===-- llvm-diff.cpp - Module comparator command-line driver ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
#include <memory>
#include <string>
#include "common/buffer/buffer_impl.h"
#include "common/http/header_map_impl.h"
#include "extensions/filters/http/dynamo/dynamo_filter.h"
#include "test/mocks/http/mocks.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/stats/mocks.h"
#include "test/test_common/printer... |
{std::array<float,2>{0.89678973f, 0.103728056f},
std::array<float,2>{0.18738313f, 0.686939657f},
std::array<float,2>{0.491404653f, 0.363231957f},
std::array<float,2>{0.529806197f, 0.790773034f},
std::array<float,2>{0.716216505f, 0.454463363f},
std::array<float,2>{0.317255616f, 0.950312376f},
std::array<float,2>{0.11485... |
/* internaltest.cc: test of the Xapian internals
*
* Copyright 1999,2000,2001 BrightStation PLC
* Copyright 2002 Ananova Ltd
* Copyright 2002,2003,2006,2007,2008,2009,2010 Olly Betts
* Copyright 2006 Lemur Consulting Ltd
*
* This program is free software; you can redistribute it and/or
* modify it under the ter... |
// Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2017-2018 The Bulwark developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/... |
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2018 The Sunplatform developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING ... |
/*
* Authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2008-2012
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software, to deal in the software without restriction,
* including without limitation the rights to use, cop... |
/*
* Copyright (c) 2013-2014,2018-2020 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
* not be construed as granting a license to any other intellectual
* property including but not limited to intellectual property relating
* to a hardware implementati... |
#pragma once
#include "BWAPI.h"
#ifdef BWAPI4
#include <chrono>
#elif BWAPI3
#include <boost/chrono.hpp>
#endif
#include <fstream>
#ifdef BWAPI4
enum struct WinReason { Eliminated, Crash };
enum struct Winner { Self, Enemy };
#define WR WinReason::
#define Wn Winner::
#define _NOEXCEPT noexcept
using SteadyClock = s... |
/*
This source file is part of GIMPACT Library.
For the latest info, see http://gimpact.sourceforge.net/
Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
email: projectileman@yahoo.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for... |
extern "C"
{
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
}
#include <luabind/luabind.hpp>
#include <luabind/class.hpp>
#include <luabind/function.hpp>
#include <luabind/object.hpp>
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
struct glut_constants {};
struct gl_constants {};
using l... |
// Copyright (c) 2014-2016 The Dash developers
// Copyright (c) 2015-2018 The PIVX developers
// Copyright (c) 2018-2020 The DAPS Project developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "activemasternode.... |
#include "AliAnalysisTaskSE.h"
#include "AliAnalysisManager.h"
#include "AliAnalysisDataContainer.h"
#include "AliAODEvent.h"
#include "AliStack.h"
#include "AliPID.h"
#include "AliMCEventHandler.h"
#include "AliMCEvent.h"
#include "AliAODTracklets.h"
#include "AliAODTrack.h"
#include "AliESDtrack.h"
#include "AliESDVe... |
// problem link :- https://leetcode.com/problems/add-two-numbers/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(ne... |
/**
* Copyright (c) 2016-present, Facebook, 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 ag... |
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The AMBANKCOIN developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-licen... |
//===- mlir-cpu-runner.cpp - MLIR CPU Execution Driver---------------------===//
//
// 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
//
// http://www.... |
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2012, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following... |
#include <vector>
#include <Rcpp.h>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/index/rtree.hpp>
using namespace Rcpp;
#include "landscape.h"
#include <vector>
#include <algorithm>
#include <functional>
std::mt19937 rng;
void Resources::initResources() {
/... |
#include "LinearAlgebra.h"
void LinearAlgebra::product(matrix& A, vector& v, vector& v1)
{
if (A.value != NULL && v.value != NULL && v.n == A.n)
{
bool flag = true;
if (v1.value == NULL && v1.n != A.m)
{
flag = vec.initialize(v1, A.m);
}
if (flag == true)
{
for (int i = 0; i < A.m; i++... |
/* +---------------------------------------------------------------------------+
| Mobile Robot Programming Toolkit (MRPT) |
| http://www.mrpt.org/ |
| ... |
/* THIS FILE WAS AUTOMATICALLY GENERATED BY format.py */
#pragma once
const char *lineitem_sample = "1|15519|785|1|17|24386.670000|0.040000|0.020000|N|O|1996-03-13|1996-02-12|1996-03-22|DELIVER IN PERSON|TRUCK|egular courts above the\n1|6731|732|2|36|58958.280000|0.090000|0.060000|N|O|1996-04-12|1996-02-28|1996-04-2... |
#include <upcxx/upcxx.hpp>
#include <tuple>
int main() {
upcxx::init();
long v = 0;
std::pair<long *,int> sp(&v,1);
using V = double;
upcxx::global_ptr<V> gp = upcxx::new_<V>();
std::pair<upcxx::global_ptr<V>,int> dp(gp,1);
upcxx::rput_irregular(&sp,&sp+1,
&dp,&dp+1).wait();
... |
/* Given an array of integers `nums` sorted in ascending order, find the start-
* ing and ending position of given `target` value.
*
* Your algorithm's runtime complexity must be in the order of O(log n).
*
* If the target is not found in the array, return `[-1, -1]`.
*/
#include <iostream>
#include <vector>
us... |
/**
* @file
* @author Jason M. Carter
* @author Aaron E. Ferber
* @date April 2017
* @version
*
* @copyright Copyright 2017 US DOT - Joint Program Office
*
* 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 ... |
// Copyright (c) 2016 ASMlover. All rights reserved.
//
// ____ __
// /\ _`\ /\ \
// \ \ \/\_\\ \ \___ __ ___ ____
// \ \ \/_/_\ \ _ `\ /'__`\ / __`\ /',__\
// \ \ \L\ \\ \ \ \ \/\ \L\.\_/\ \L\ \/\__, `\
// \ \____/ \ \_\ \_\ \__/.\_\ \____/\/\____/
// \/___/ \/_/\/_/\/__/\/_/\/___... |
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <vector>
#include <memory>
#include <transformations_visibility.hpp>
#include <ngraph/pass/graph_rewrite.hpp>
namespace ngraph {
namespace pass {
class TRANSFORMATIONS_API ConvertOpSet1ToLegacy;
} // namespa... |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2005, 2006 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribu... |
#include <debugger/io/namedpipe.h>
#include <Windows.h>
#include <debugger/client/run.h>
#include <debugger/io/base.h>
#include <debugger/io/helper.h>
#include <debugger/client/stdinput.h>
#include <base/util/format.h>
#include <base/path/self.h>
#include <functional>
void request_runInTerminal(vscode::io::base* io, s... |
/** \copyright
* Copyright (c) 2013, Balazs Racz
* 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 li... |
// Copyright (c) Facebook, Inc. and its affiliates.
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
#include "PrivateDataBase.h"
namespace facebook {
namespace react {
PrivateDataBase::~PrivateDataBase() {}
} }
|
#include "geohash/base32.hpp"
namespace geohash {
// Invalid character in an encoding
const char Base32::kInvalid_ = std::numeric_limits<char>::max();
// Encoding characters
const std::array<char, 32> Base32::encode_ =
std::array<char, 32>({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'b',
... |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/events/x/touch_factory_x11.h"
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
#include <X11/extensions/XInput.h>
#include <X11/extens... |
/*
// Struct_definition.h defines different types of sturctures being used in the implementation of MSCKF
*/
#ifndef STRUCT_DEF_H
#define STRUCT_DEF_H
#include <Eigen/Dense>
#include <map>
#include <set>
#include "Parameters.hpp"
#include <deque>
#define PI 3.1415926535
#define ... |
#include "FWCore/Utilities/interface/Exception.h"
#include "SimG4Core/Geometry/interface/DD4hep_DDG4Builder.h"
#include "SimG4Core/Geometry/interface/SensitiveDetectorCatalog.h"
#include "DetectorDescription/DDCMS/interface/DDCompactView.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include <DDG4/Ge... |
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2015-2017 The HERB developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-li... |
#include "sass.hpp"
#include <cctype>
#include <iostream>
#include <iomanip>
#include "util.hpp"
#include "position.hpp"
#include "prelexer.hpp"
#include "constants.hpp"
namespace Sass {
// using namespace Lexer;
using namespace Constants;
namespace Prelexer {
/*
def string_re(open, close)
... |
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" fil... |
/**
* pugixml parser - version 1.6
* --------------------------------------------------------
* Copyright (C) 2006-2015, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at http://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
*... |
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "bin/file.h"
#include "bin/builtin.h"
#include "bin/dartutils.h"
#include "bin/io_buffer.h"
#... |
#include "CondFormats/EcalObjects/interface/EcalTPGGroups.h"
#include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixAmplitu... |
#define CATCH_CONFIG_MAIN
#include <flyweight/object.hpp>
#include <string>
#include <catch.hpp>
TEST_CASE("object-constructor", "[object][constructor]") {
flyweight::object<std::string> empty { };
CHECK(empty.get().empty());
}
TEST_CASE("object-value-constrctor") {
flyweight::object<std::string> value { "valu... |
#define SECURITY_WIN32 // For sspi.h
#include "intrinfix.h"
#include "windows.fixed.h"
#include <sdkddkver.h>
#include <mmsystem.h>
#include <dsound.h>
|
/*=========================================================================
Program: Image Guided Surgery Software Toolkit
Module: igstkTubeReaderTest.cxx
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) ISC Insight Software Consortium. All rights reserved.
See IGSTKCopyright.... |
/*
Copyright 2007-2009 WebDriver committers
Copyright 2007-2009 Google Inc.
Portions copyright 2007 ThoughtWorks, 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... |
/**
* A collection of fluid runaway source terms.
*/
#include <algorithm>
#include "DREAM/DREAMException.hpp"
#include "DREAM/Equations/RunawaySourceTermHandler.hpp"
#include "FVM/Equation/Operator.hpp"
#include "FVM/Grid/Grid.hpp"
#include "FVM/Matrix.hpp"
using namespace DREAM;
using namespace std;
/**
* Cons... |
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//
// Copyright (c) 2011 The... |
#ifndef OSMIUM_IO_OUTPUT_ITERATOR_HPP
#define OSMIUM_IO_OUTPUT_ITERATOR_HPP
/*
This file is part of Osmium (http://osmcode.org/libosmium).
Copyright 2013-2016 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge... |
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include <s... |
/**
* Calculate the sum of two integers a and b, but you are not allowed to
* use the operate + and -.
*
* Example 1:
* Input: a = 1, b = 2
* Output: 3
*
* Example 2:
* Input a = -2, b = 3
* Output: 1
*/
class Solution {
public:
int getSum(int a, int b) {
int ans = a ^ b;
... |
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2018 The PIVX developers
// Copyright (c) 2019 The BDRcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "masternode-payments.h"
#inc... |
/***************************************************************
leetcode-hard-135:Candy
There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these children subjected to the following requirements:
- Each child must have at least one candy.
- Children with a higher ... |
#include <QtGlobal>
// Automatically generated by extract_strings.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif
static const char UNUSED *startlife_strings[] = {
QT_TRANSLATE_NOOP("startlife-core", ""
"(1 = keep tx meta data e.g. account owner and payment request information, ... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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... |
#include <assert.h>
#include <pcap/pcap.h>
#include <sys/ioctl.h>
#include <cstring>
#include <string.h>
#include "pcap_session.h"
using namespace v8;
Nan::Persistent<Function> PcapSession::constructor;
PcapSession::PcapSession() {};
PcapSession::~PcapSession() {};
void PcapSession::Init(Local<Object> exports) {
... |
// MIT License
//
// Copyright (c) 2020 Olivier Le Doeuff
//
// 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, m... |
#include "ColonialFlags/ColonialFlagRegion.h"
#include "gtest/gtest.h"
TEST(Mappers_ColonialFlagRegionTests, flagsDefaultToEmpty)
{
std::stringstream input;
const mappers::ColonialFlagRegion region(input, "region");
ASSERT_TRUE(region.getRegionalFlags().empty());
}
TEST(Mappers_ColonialFlagRegionTests, flagsCanBe... |
#include "gvariantproxy.h"
using namespace v8;
Nan::Persistent<FunctionTemplate> GVariantProxy::constructor;
GVariantProxy::GVariantProxy() {
}
GVariantProxy::~GVariantProxy() {
if (dict != NULL) {
g_variant_dict_unref(dict);
g_variant_unref(variant);
dict = NULL;
variant = NULL;
}
}
void GVariantProxy:... |
#include "GpioOutput.hpp"
#include "Logging.hpp"
#include "SignalProvider.hpp"
using namespace std;
// Name returns the instance name
string GpioOutput::Name(void)
{
return this->chip.name() + "/" + this->line.name();
}
void GpioOutput::Apply(void)
{
if (this->newLevel != this->level)
{
this->l... |
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied w... |
#include "CameraImageWrapper.h"
#include <QColor>
#include <QApplication>
#include <QDesktopWidget>
CameraImageWrapper::CameraImageWrapper() : LuminanceSource()
{
}
CameraImageWrapper::CameraImageWrapper(CameraImageWrapper& otherInstance) : LuminanceSource()
{
image = otherInstance.... |
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string str1,str2;
char ex;
cin >>str1>>str2;
cout <<str1.size()<<" "<<str2.size()<<endl;
cout <<str1+str2<<endl;
swap(str1[0],str2[0]);
cout <<str1<<" "<<str2;
return 0;
}
|
// to use c++ style logging
// specifically define this before including loguru.hpp
#define LOGURU_WITH_STREAMS 1
#include <grpcpp/grpcpp.h>
#include <bsoncxx/builder/stream/document.hpp>
#include <bsoncxx/json.hpp>
#include <iostream>
#include <map>
#include <memory>
#include <mongocxx/client.hpp>
#include <mongocxx... |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOSPRayRendererNode.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This sof... |
// Taken from the Boost.Function library
// Copyright Douglas Gregor 2001-2003.
// Copyright 2013 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://... |
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-11 by Raw Material Software Ltd.
------------------------------------------------------------------------------
JUCE can be redistrib... |
#include <vector>
#include <numeric>
#include <iostream>
#include <cassert>
#include "adjacent_difference.h"
int
main(int argc, char** argv)
{
std::vector<value_type> a{1, 5, -2, 4, 0};
std::vector<value_type> result1(a.size());
std::vector<value_type> result2(a.size());
adjacent_difference(a.data(), a.size()... |
/*
* utest_polyline.cpp
*
* Created on: Nov 19, 2020 21:00
* Description:
*
* Copyright (c) 2020 Ruixiang Du (rdu)
*/
#include "gtest/gtest.h"
#include "geometry/polyline.hpp"
using namespace robosw;
struct PolylineTest : testing::Test {
PolylineTest() {
polyline.AddPoint(0, 0);
polyline.AddPoint(0... |
// Copyright (c) 2014 The Sumcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "main.h"
#include "rpcserver.h"
#include <boost/lexical_cast.hpp>
#include <algorithm>
#include <string>
#include "smess... |
/* BSD 2-Clause License
Copyright (c) 2016, Doi Yusuke
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 conditions... |
#include <flutter/dart_project.h>
#include <flutter/flutter_view_controller.h>
#include <windows.h>
#include "flutter_window.h"
#include "utils.h"
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
_In_ wchar_t *command_line, _In_ int show_command) {
// Attach to console w... |
//=================================================================================================
/*!
// \file src/mathtest/dmatdmatadd/SDaSDa.cpp
// \brief Source file for the SDaSDa dense matrix/dense matrix addition math test
//
// Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved
//
// This file i... |
#include <iostream>
#include <vector>
using namespace std;
bool isValid(int n, int i, int j, vector<vector<char>>& grid)
{
if (i >= 1 && j >= 2)
{
if (grid[i - 1][j - 2] == 'K')
{
return false;
}
}
if (i >= 2 && j >= 1)
{
if (grid[i - 2][j - 1] == 'K')
... |
#include <bits/stdc++.h>
template<typename T> T gcd(T a, T b) {
if(!b) return a;
return gcd(b, a % b);
}
template<typename T> T lcm(T a, T b) {
return a * b / gcd(a, b);
}
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; }
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; ... |
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "extern/beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.ValueType
#include "System/ValueType.hpp"
// Including type: S... |
#include <boost/spirit/include/support_attributes_fwd.hpp>
|
struct Path {
int last;
int bitmask;
int cost;
Path() : last(0), bitmask(0), cost(0) {}
void addPoint(int p, int c = 1) {
last = p;
cost += c;
bitmask = bitmask | (1 << p);
}
};
class Solution {
public:
int shortestPathLength(vector<vector<int>> &graph) {
queue<Path> pq;
int n = graph... |
/* -*- C++ -*- */
#include "qtluaprinter.h"
#include <QDialog>
#include <QPrintDialog>
struct Option
{
const char *name;
int value;
};
#define F(t) {#t, (int) QPrinter::t}
static Option pageSizes[] = {
F(A4), F(B5), F(Letter), F(Legal), F(Executive),
F(A0), F(A1), F(A2), F(A3), F(A5), F(A6), F(A7), F(... |
//===- TypeUtils.cpp - Helper function for manipulating types -------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
/*
===========================================================================
Moka Source Code
Copyright 2019 Stuart Adams. All rights reserved.
https://github.com/stuartdadams/moka
stuartdadams | linkedin.com/in/stuartdadams
This file is part of the Moka Real-Time Physically-Based Rendering Project.
Permission is h... |
#include <iostream>
using namespace std;
struct node {
int val;
node *left;
node *right;
};
void print(node *proot) {
if (proot == nullptr) {
return;
}
cout << proot->val << endl;
print(proot->left);
print(proot->right);
}
int count(node *proot) {
if (proot == nullptr) {
... |
#pragma once
#include <vector>
namespace polyvec
{
struct EmptyData
{ };
template <typename EntryData = EmptyData>
class UnionFind
{
struct UFEntry : public EntryData
{
int parent;
};
public:
UnionFind(size_t size)
{
uf.resize(size);
for (int i = 0; i < uf.size(); ++i)
uf[i].parent =... |
/******************************************************************************
* Copyright 2018 The Apollo 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
... |
#include "grid.h"
#include "wordlist.h"
#include <unicode/ustream.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <vector>
int get_size(icu::UnicodeString s) {
int size = sqrt(s.length());
if (size * size != s.length())
throw std::runtime_error("Invalid number of charact... |
/**
* @file
* @author Aapo Kyrola <akyrola@cs.cmu.edu>
* @version 1.0
*
* @section LICENSE
*
* Copyright [2012] [Aapo Kyrola, Guy Blelloch, Carlos Guestrin / Carnegie Mellon University]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with... |
// Copyright (c) 2012-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "key.h"
#include "keystore.h"
#include "validation.h"
#include "policy/policy.h"
#include "script/script.h"
#include... |
#include<iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a + b;
} |
#include"localization_ekf/localization_ekf.h"
kalman_filter::kalman_filter()
{
param=new EKF_param();
pose_state={0,0,0};
input_state={0,0,0};
param->F_x=identity;
param->F_u=identity;
param->Q={{abs(input_state[0]),0,0},{0,abs(input_state[1]),0},{0,0,abs(input_state[2])}};
param->P=float(0.01)*(mat<float,3,3>)i... |
/*
* Copyright 2009-2017 Alibaba Cloud 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... |
#include <iostream>
#include <sstream>
#include <string>
#include <slhaea.h>
using namespace std;
using namespace SLHAea;
int main()
{
double alpha_em = 127.934;
double G_mu = 1.16637e-05;
double alpha_s = 0.1172;
double m_Z = 91.1876;
double m_b = 4.25;
double m_t = 174.3;
double m_... |
// Copyright (c) 2014-2018 Sebastien Rombauts (sebastien.rombauts@gmail.com)
//
// Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
// or copy at http://opensource.org/licenses/MIT)
#include "GitSourceControlState.h"
#define LOCTEXT_NAMESPACE "GitSourceControl.State"
int32 FGitSourceControl... |
#pragma once
#include "track.hpp"
#include "transform.hpp"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.