text stringlengths 7 961k |
|---|
#include "../lua/impl.hpp"
#include "../input/input.hpp"
DEF_LUAIMPLEMENT_PTR_NOCTOR(
rev::Input, Input,
LUAIMPLEMENT_BASE,
NOTHING,
NOTHING,
(name)(getButton)(getAxis)(getHat)(numButtons)(numAxes)(numHats)
(setDeadZone)(setMouseMode)(getMouseMode)(getPointer)
)
DEF_LUAIMPLEMENT_PTR_NOCTOR(
rev::Action, Action,... |
#include "Application.hpp"
#include "States/DummyState.hpp"
#include "States/GameState.hpp"
#include <SFML/Graphics/Text.hpp>
#include <SFML/Window/Event.hpp>
#include <chrono>
typedef std::chrono::high_resolution_clock chrono_clock;
typedef chrono_clock::duration duration;
typedef chrono_clock::time_point time_poin... |
/*
* Copyright 2018, Magazino GmbH, Sebastian Pütz, Jorge Santos Simón
*
* 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 retain the above copyright
* notice, t... |
//
// DepthwiseConvInt8Execution.hpp
// MNN
//
// Created by MNN on 2019/6/19.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef DepthwiseConvInt8Execution_hpp
#define DepthwiseConvInt8Execution_hpp
#include "CommonExecution.hpp"
#include <MNN_generated.h>
#include "Execution.hpp"
#include "core/OpenC... |
/* NOCHKSRC */
#line 2 "l_filter.c"
#line 4 "l_filter.c"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define yy_create_buffer filter_create_buffer
#define yy_delete_buffer filter_delete_buffer
#define yy_flex_debug filter_flex_debug
#define yy_init_buffer filter_init_buffer
#define y... |
/*
* Copyright 2018 Autoware Foundation. 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 b... |
/* Copyright (c) 2017, United States Government, as represented by the
* Administrator of the National Aeronautics and Space Administration.
*
* All rights reserved.
*
* The Astrobee platform is licensed under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with t... |
/*
* Copyright (C) 2020 StreetDrone Limited - All rights reserved
*
* Author: Fionán O'Sullivan
*
* Based on original work of: Efimia Panagiotaki
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributi... |
/**
* Copyright (C) 2018-present MongoDB, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but W... |
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// 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 restrictio... |
class Solution {
public:
int XXX(vector<int>& nums, int target) {
if(nums.size() == 0 || nums[0] > target) return 0;
if(nums.back() < target) return nums.size();
int l = 0, r = nums.size() - 1;
while(l <= r){
int mid = l + (r-l)/2;
if(nums[mid] == target){
... |
/* _________________________________________________________________________
*
* Acro: A Common Repository for Optimizers
* Copyright (c) 2008 Sandia Corporation.
* This software is distributed under the BSD License.
* Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
* the U.S. Governm... |
/*
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gro... |
///
/// @file PrimeGenerator.hpp
/// Generates the primes inside [start, stop] and stores them
/// in a vector. After the primes have been stored in the
/// vector primesieve::iterator iterates over the vector and
/// returns the primes. When there are no more primes left in
/// the ... |
/*
* Copyright (c) 2018 GYB, Inc., and contributors.
*
* The MIT License
*
* 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
... |
\*
Author: allannozomu
Runtime: 20 ms
Memory: 11.4 MB*\
class Solution {
public:
bool isBipartite(vector<vector<int>>& graph) {
vector<int> colors = vector<int>(graph.size());
for(int node = 0; node < graph.size(); ++node){
if (colors[node]) {
continue;
... |
//===- InstCombineAndOrXor.cpp --------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
/*This file is part of the FEBio Studio source code and is licensed under the MIT license
listed below.
See Copyright-FEBio-Studio.txt for details.
Copyright (c) 2021 University of Utah, The Trustees of Columbia University in
the City of New York, and others.
Permission is hereby granted, free of charge, to any pers... |
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
#include "beatsaber-hook/shared/utils/byref.hpp"
// Including type: OVR.OpenVR.IVRTrackedCamera
#includ... |
#include "pch.h"
#include "factory.h"
void bullet_body_create_generic(lua_State* L, btCollisionShape* shape, FLOAT mass, const btTransform& tr,
btVector3 inertia = btVector3(0, 0, 0))
{
auto* motion = new btDefaultMotionState(tr);
const btRigidBody::btRigidBodyConstructionInfo c... |
//
// Copyright (c) 2019 Loïc HAMOT
//
// 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)
//
#include "rah.hpp"
#ifdef MSVC
#pragma warning(push, 0)
#endif
#include <iostream>
#include <vector>
#include <map>
#includ... |
// 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: OVRPlugin
#include "G... |
#include "crypto.h"
#include <openssl/evp.h>
#include <fstream>
#include <sstream>
#include <iostream>
#include <vector>
#include <opensslpp/base64.h>
#include <opensslpp/aes_cbc.h>
void base64_encode(const void* in_data, int in_length, char** out_data, int& out_length)
{
const auto pl = 4 * ((in_length + 2) / 3);
... |
// Filename: maxEggImport.cxx
// Created by: jyelon (15Jul05)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You sho... |
#include <AComponent/function.h>
#include <iostream>
namespace a
{
void function()
{
std::cout << "Run APackage function()"
<< "\n";
}
} |
#include <fstream>
#include <iostream>
using namespace std;
int main() {
int n, ans;
long long sum = 0;
cin >> n;
for(int h = 1 ; ; ++ h) {
sum = sum + h;
if(n >= sum) {
ans = h;
n -= sum;
}
else {
cout << h - 1 << '\n';
break;
}
}
} |
/*
**==============================================================================
**
** Copyright (c) 2003, 2004, 2005, 2006, Michael Brasher, Karl Schopmeyer
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and associated documentation files (the "Software"),
** ... |
#include "nonce_num_set.h"
NonceNumRange NonceNumSet::CutPieceAtBeginning( uint64_t preferredSplitSize )
{
EXCEPTION_ASSERT( !AreAnyNoncesOverlapping() );
EXCEPTION_ASSERT( !ranges_.empty() );
NonceNumRange firstRange = *ranges_.cbegin();
ranges_.erase( ranges_.cbegin() );
auto splitResult = firs... |
#pragma once
#include <stdafx.h>
#include <Utils.h> |
/*!
@file
Defines `boost::hana::iterate`.
@copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_FUNCTIONAL_ITERATE_HPP
#define BOOST_HANA_FUNCTIONAL_ITERATE_HPP
#include <boost... |
/******************************************************************************
* $Id: ogrwalkdriver.cpp
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRWalkDriver class.
* Author: Xian Chen, chenxian at walkinfo.com.cn
*
************************************************... |
// Copyright 2013 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 "net/disk_cache/simple/simple_test_util.h"
#include "base/files/file.h"
#include "net/disk_cache/simple/simple_util.h"
namespace disk_cache {
n... |
#include<iostream>
using namespace std;
void checkPrimeNumber(int);
int main()
{
int num;
cout<<"Enter a Number: ";
cin>>num;
checkPrimeNumber(num);
cout<<endl;
return 0;
}
void checkPrimeNumber(int num)
{
int i, chk=0;
for(i=2; i<num; i++)
{
if(num%i==0)
{
... |
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writ... |
#include "Janela.hpp"
#include "Jogador.hpp"
Janela::Janela (int resolucao_x, int resolucao_y, std::string nome, int largura, int altura, int fps_maximo)
: janela(sf::VideoMode(largura, altura), nome, sf::Style::Titlebar | sf::Style::Resize)
, camera(sf::Vector2f(0.0f,0.0f), sf::Vector2f(largura, altura))
, _jogado... |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... |
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <cstring>
#include <gna_plugin_log.hpp>
#include <limits>
#include "backend/gna_types.h"
#include "quantization.h"
#include <algorithm>
#ifdef DEBUG
#define QUANTWARNING(...) (fprintf(stderr, __VA_ARGS__))
#else
#define QU... |
//#include <eve/function/is_not_real.hpp>
#include <eve/module/ieee.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float, eve::fixed<4>>;
int main()
{
wide_ft pf = {0.0f, 1.0f, -0.0f, -2.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
... |
#ifndef HPP_035_PKT_NPC_ForceDead_HPP
#define HPP_035_PKT_NPC_ForceDead_HPP
#include "base.hpp"
#pragma pack(push, 1)
struct PKT_NPC_ForceDead_s : DefaultPacket<PKT_NPC_ForceDead>
{
};
#pragma pack(pop)
#endif |
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Contributing authors:
* Samuel Gagnon <samuel.gagnon92@gmail.com>
*
* Copyright:
* Christian Schulte, 2002
* Samuel Gagnon, 2018
*
* This file is part of Gecod... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
#include <nano/lib/asio.hpp>
nano::shared_const_buffer::shared_const_buffer (const std::vector<uint8_t> & data) :
m_data (std::make_shared<std::vector<uint8_t>> (data)),
m_buffer (boost::asio::buffer (*m_data))
{
}
nano::shared_const_buffer::shared_const_buffer (std::vector<uint8_t> && data) :
m_data (std... |
/*
* Copyright (c) 2017-2018 Shehryar Khurshid <shryr.kd@gmail.com>
*
* 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 retain the above copyright
* notice, this list o... |
/*
* Copyright (c) 2015 - 2021, Intel Corporation
*
* 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 condition... |
#include "quitest.h"
QuiTest::QuiTest(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
} |
/******************************************************************************
* $Id$
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRMySQLDriver class.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
*******************************************************************... |
#include "PCFG.h"
#include "debug.h"
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(int argc, char* argv[]) {
DebugStream::threashold_ = DebugStream::I;
srand((unsigned)time(0));
cerr << "reading cnf grammar..." << endl;
PCFG aPCFG;
cin >> aPCFG;
cout << aPCFG.generateSamples(10)... |
#include "RandDoter.hpp"
#include "digit_numbers.h"
#include "DXUT.h"
#include "Geometry/vertex.h"
//#define __DEBUG__ 1
using namespace EyeStereo;
RandomDot::RandomDot(int maxbound):pd3dDevice(0), iVertexNum(-1), dotDist(0.005), maxPointNum(maxbound) {}
RandomDot::~RandomDot() {
SAFE_DELETE( vertices[0] );
SAF... |
#pragma once
// This file is generated from the Game's Reflection data
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/REDhash.hpp>
#include <RED4ext/Types/generated/ent/IComponent.hpp>
namespace RED4ext
{
namespace game {
struct TargetingActivatorComponent : ent::IComponent
{
static constexp... |
#ifndef EHDG_SWE_DATA_HPP
#define EHDG_SWE_DATA_HPP
#include "ehdg_swe_data_state.hpp"
#include "ehdg_swe_data_internal.hpp"
#include "ehdg_swe_data_boundary.hpp"
#include "ehdg_swe_data_source.hpp"
#include "ehdg_swe_data_wet_dry.hpp"
#include "ehdg_swe_data_slope_limit.hpp"
namespace SWE {
namespace EHDG {
struct D... |
/*
* Copyright (C) 2009 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 conditio... |
// 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 "android_webview/browser/find_helper.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h... |
#ifndef GREGORIAN_FACET_HPP___
#define GREGORIAN_FACET_HPP___
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garlan... |
/*
* 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" file... |
#include <catch.hpp>
#include <internal/facts/resolvers/operating_system_resolver.hpp>
#include <facter/facts/collection.hpp>
#include <facter/facts/fact.hpp>
#include <facter/facts/scalar_value.hpp>
#include <facter/facts/map_value.hpp>
using namespace std;
using namespace facter::facts;
using namespace facter::facts... |
/***********************************************************************************
* Copyright (C) 2008 by Filip Rooms *
* *
* Terms and conditions for using this software in any form are ... |
#include "C:\!!BITBUCKET\11l-lang\_11l_to_cpp\11l.hpp"
auto MAX_DIST = 1999999999.0;
auto PI_SOBRE_180 = 0.017453292;
auto PEQUENO = 0.000000001;
template <typename T1> auto colorToString(const T1 &c)
{
return u"#. #. #."_S.format(to_int(max(0.0, min(c.r * 255.0, 255.0))), to_int(max(0.0, min(c.g * 255.0, 255.0)... |
#include "InitState.h"
void InitState::entry(void) {
std::cout
<< "==================================" << endl
<< " WELCOME TO THE TEST STATE MACHINE" << endl
<< "==================================" << endl
<< endl
<< "========================" << endl
<< " PRESS S t... |
/*
* Copyright (c) 2014 The WebM project authors. All Rights Reserved.
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "WebMFileWriter.h"
#includ... |
#include <fstream>
using namespace std;
ifstream f("ec.in");
ofstream g("ec.out");
int a,b,x;
int main()
{
f>>a>>b;
if(a)
{
x=-b/a;
g<<x<<endl;
}
else if(a==0&&b==0) g<<"Infinitate solutii"<<endl;
else g<<"Nu are solutii"<<endl;
f.close();
g.close();
return 0;
} |
//-----------------------------------------------------------------------------
// Software that is described herein is for illustrative purposes only
// which provides customers with programming information regarding the
// products. This software is supplied "AS IS" without any warranties.
// NXP Semiconductors... |
// Boost string_algo library collection_traits.hpp header file -------------//
// Copyright Pavol Droba 2002-2003. 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://www.boost.org/LICENSE_1_0.txt)
// (C) Cop... |
/*
*************************************************************************
*
* PCX_COMM.C - PCX_LIB Library Common Functions
*
* Version: 1.00B
*
* History: 91/02/14 - Created
* 91/04/01 - Release 1.00A
* 91/04/03 - fixed "segread" call.
* 91/04/07 - Release 1... |
/*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sandstone_context_dump.h"
#include "sandstone.h"
#include "amx_common.h"
#include "cpu_features.h"
#include "fp_vectors/Floats.h"
#include <algorithm>
#include <limits>
#ifdef __unix__
# include <dlfcn.h>
#endif
#include <immintrin.h>
#include <inttypes.h>
#i... |
//..............................
// UI Lab Inc. Arthur Amshukov .
//..............................
#ifndef __ARCTURUS_TYPE_H__
#define __ARCTURUS_TYPE_H__
#pragma once
BEGIN_NAMESPACE(arcturus)
USING_NAMESPACE(core)
USING_NAMESPACE(frontend)
struct arcturus_type_traits
{
DECLARE_ENUM
(
kind,
... |
#ifndef BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED
#define BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// 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)
//
// See http://www.boost.org... |
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------... |
#include "EngineSrc/Technique/MaterialPool.h"
#include "EngineSrc/Rendering/Renderer.h"
#include "../../Scene/SceneMgr.h"
#include "EngineSrc/3D/Vegetation/Tree.h"
#include "3D/Model/Model.h"
#include "Mesh/InstancedMesh.h"
namespace tzw {
VegetationBatInfo::VegetationBatInfo()
{
}
VegetationBatInfo::VegetationBatIn... |
/*=============================================================================
NifTK: A software platform for medical image computing.
Copyright (c) University College London (UCL). All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY o... |
/*
* David Salac
*/
#ifndef MIRROR_HPP
#define MIRROR_HPP
#include <string>
#include <tuple>
#include "MirrorIntersectionParameters.h"
/**
* Represents one mirror in 2D space
*/
class Mirror {
private:
const double m_x_start;
const double m_x_end;
const double m_y_start;
const double m_y_end;
... |
// Copyright (C) 2016 Vicente J. Botet Escriba
//
// 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)
// <experimental/functor.hpp>
// <experimental/utility.hpp> pair
#include <experimental/utility.hpp>
#include <ex... |
// Copyright 2014 the V8 project 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/compiler/machine-operator-reducer.h"
#include <cmath>
#include "src/base/bits.h"
#include "src/base/division-by-constant.h"
#include "src... |
/**
* @file camoto/gamemusic/music.hpp
* @brief Declaration of top-level Music class, for in-memory representation
* of all music formats.
*
* Copyright (C) 2010-2015 Adam Nielsen <malvineous@shikadi.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of th... |
//======================================================================================================================
// jumpdir - A smart directory navigation command
//
// Copyright 2017 Steve Hollasch. All rights reserved.
//=========================================================================================... |
/*
* This file corresponds to SimControlPanel.ui and sets everything about
* the simulator control panel.
* The default mode and robot have been set to Simulator and Milab robot,
* users can click the start button directly to start the simulation.
*/
#include "SimControlPanel.h"
#include <ControlParameters/Con... |
#include "ast.hpp"
AST::AST(QObject *parent)
: QAbstractItemModel(parent)
{
}
QVariant AST::headerData(int section, Qt::Orientation orientation, int role) const
{
// FIXME: Implement me!
}
QModelIndex AST::index(int row, int column, const QModelIndex &parent) const
{
// FIXME: Implement me!
}
QModelInde... |
/**
******************************************************************************
* This file is part of the TouchGFX 4.10.0 distribution.
*
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Libert... |
#include "game.h"
#include "tetris.h"
int main(int argc, char *argv[]) {
Tetris *t = new Tetris();
Game *g = new Game(t);
printf("Aqui\n");
g->run_loop();
return 0;
} |
/*
* Copyright (C) 2009 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 conditio... |
class Solution {
public:
string XXX(string s, int numRows) {
int l=s.size();
int t=0;
if(numRows==1){
return s;
}
int sum;
if(l<(2*numRows-2)){
sum=1+(l%numRows);
}else{
sum=(l/(2*numRows-2))*(numRows-1);
if((l-(... |
//-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (c) 2008-2022 Ryo Suzuki
// Copyright (c) 2016-2022 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# include <Siv3D/EngineLog.hpp>
# include <Siv... |
// Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "sendcoinsdialog.h"
#in... |
#ifndef TEXT_MANAGER_HPP
#define TEXT_MANAGER_HPP
#include <ft2build.h>
#include FT_FREETYPE_H
#include "Texture.hpp"
#include "Sprite.hpp"
#include "FontId.hpp"
class GlyphTexture : public Texture {
public:
GlyphTexture();
~GlyphTexture();
bool init(const FT_GlyphSlot &glyph);
};
class ... |
#include "fileWatcher.hh"
#ifdef __linux__
#include "fileWatcher_linux.cpp"
#elif __APPLE__
#include "fileWatcher_osx.cpp"
#endif |
#include <cstdio>
#include <csignal>
#include <unistd.h>
#include "CmdOptions.h"
#include "NetServer.h"
#include "ServerApp.h"
ServerApp *G_pApp = nullptr;
bool G_RUNNING = true;
void SignalHandler(int signum)
{
G_RUNNING = false;
if (G_pApp)
{
G_pApp->Stop();
}
}
int main(int argc, char *ar... |
//-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (C) 2008-2016 Ryo Suzuki
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# pragma once
# include "Fwd.hpp"
# include "Optional.hpp"
# include "PointVector.hpp"
# in... |
#ifndef GeometryService_src_DetectorSystemMaker_hh
#define GeometryService_src_DetectorSystemMaker_hh
//
// Construct a DetectorSystem object.
//
// $Id: DetectorSystemMaker.hh,v 1.6 2013/03/15 15:52:04 kutschke Exp $
// $Author: kutschke $
// $Date: 2013/03/15 15:52:04 $
//
// Original author Rob Kutschke
//
// C++ i... |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define rep(i, s, t) for(int i = s;i <= t;i++)
#define rap(i, s, t) for(int i = s;i >= t;i--)
using namespace std;
int C[1005], D[1005];
int N, b;
int main()
{
int t;
scanf("%d", &t);
while(t--)
{
scanf("%d%d", &N, &b)... |
/******************************************************************************
Copyright (c) 2020, Farbod Farshidian. 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 mu... |
#include "sphere.hpp"
#include <glm/vec3.hpp>
#include <cmath>
Sphere::Sphere() :
Shape{"none"},
center_{0.0, 0.0, 0.0},
radius_{1.0} {}
Sphere::Sphere(glm::vec3 const& center, double radius) :
Shape{"sphere_radius"},
center_{center},
radius_{radius} {}
Sphere::Sphere(Sphere const& x) :
Shape{"sphere_copy"},
center_... |
#include "main.h"
#include <natus/ntd/string.hpp>
#include <natus/log/global.h>
#include <natus/ntd/vector.hpp>
#include <natus/math/vector/vector2.hpp>
#include <cstdlib>
#include <chrono>
#include <limits>
#include <thread>
#include <functional>
#include <mmdeviceapi.h>
#include <audioclient.h>
#include <windows.h... |
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2015 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
... |
// Copyright 2020 The Tint 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.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed ... |
#include "stdafx.h"
#include "PlayerScenePart.h"
#include "PlayerObject.h"
PlayerScenePart::PlayerScenePart() : ScenePart()
{
AddObject(PlayerObject());
} |
/************************************************************
*
* OPEN TRANSACTIONS
*
* Financial Cryptography and Digital Cash
* Library, Protocol, API, Server, CLI, GUI
*
* -- Anonymous Numbered Accounts.
* -- Untraceable Digital Cash.
* -- Triple-Signed Receipts... |
#include "pch.h"
#include "PrimitiveUtils.h"
#include "Renderer/Gizmo.h"
namespace sixengine {
std::vector<GizmoVertex> PrimitiveUtils::generateBoxVertices(float x, float y, float z)
{
x = x / 2.0f;
y = y / 2.0f;
z = z / 2.0f;
std::vector<GizmoVertex> vertices{
// top face
GizmoVertex{ glm::vec3{-x, ... |
#include <functional>
#include "common/event/dispatcher_impl.h"
#include "test/mocks/common.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace Envoy {
using testing::InSequence;
namespace Event {
class TestDeferredDeletable : public DeferredDeletable {
public:
TestDeferredDeletable(std::function<voi... |
#include "N64.hpp"
#include "PIFrom.hpp"
using namespace ultra64;
void N64::load_pif_rom(std::string filepath)
{
ultra64::PIFrom pifrom(filepath);
uint32_t count = 0;
uint32_t *p = (uint32_t *)pifrom.get_pointer();
ultra64::map_memory(this->mmu, "pif_rom", 0x1FC00000, 0x7C0, 0x7C0, new std::byte[0x7... |
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2018, Alliance for Sustainable Energy, LLC. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are perm... |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This file is auto-generated by rute_gen. DO NOT EDIT
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "../rute_base.h"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.