text
stringlengths
3.08k
12.5k
/* $Id: minimap.cpp 48153 2011-01-01 15:57:50Z mordante $ */ /* Copyright (C) 2003 - 2011 by <NAME> <<EMAIL>> Part of the Battle for Wesnoth Project http://www.wesnoth.org/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pub...
/* * Copyright (c) 2020, NVIDIA CORPORATION. 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 co...
/** * Area Detector class enabling multi-ROI driver for the Andor CCD. * This class is used by CCD camera modules that permit multiple regions-of-interest. * * Multi-ROI is typically used for multi-track spectrocopy application. * * There are 3 use cases: * 1 - The user sets only the track start array. * ...
#include <glad/glad.h> #include <GLFW/glfw3.h> #include <tool/shader.h> #include <iostream> #define STB_IMAGE_IMPLEMENTATION #include <tool/stb_image.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include <geometry/BoxGeometry.h> void framebuffer_size_callback(GLF...
#include "reader_coord.h" #include <QFile> #include <QFileInfo> #include <QStringList> #include <iostream> #include <fstream> #include "support/small_tcspc_io_reader.h" #include <libtimetag/sstt_file2.h> reader_coord::reader_coord(QString filename) : filename(filename), time_unit(81e-12), ...
/** * @file * @brief Implements the Geant4 passive material construction process * @remarks Code is based on code from <NAME> * @copyright Copyright (c) 2017-2019 CERN and the Allpix Squared authors. * This software is distributed under the terms of the MIT License, copied verbatim in the file "LICENSE.md". * In ...
/********** This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) This libr...
/* * Copyright RIME Developers * Distributed under the BSD License * * 2011-08-29 <NAME> <<EMAIL>> */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <rime_api.h> void print_status(RimeStatus *status) { printf("schema: %s / %s\n", status->schema_id, status->schema_name); printf("s...
#include "SeedFinderOptions.hpp" #include "Acts/Seeding/Seedfinder.hpp" #include "ActsExamples/Options/CommonOptions.hpp" #include "ActsExamples/TelescopeSeeding/TelescopeSeedingAlgorithm.hpp" #include <iostream> #include <stdexcept> #include <string> #include <vector> #include <boost/program_options.hpp> using nam...
// user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacro...
/* Copyright (c) 2014 Intrepid Control Systems, 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 condit...
#include <stdlib.h> #include <stdio.h> #include <time.h> #include <SDL/SDL.h> #include <math.h> #include <GL/gl.h> #include <GL/glu.h> #include "affichage.h" #include "client.h" #define LARGEUR_FENETRE 900 #define HAUTEUR_FENETRE 700 #define DELAY_FRAME 30 #define BOAT_NUMBER 4 #define BUOY_NUMBER 5 // include po...
// Assignment 3: Euclidean traveling salesperson problem: exhaustive optimization algorithm /**************************************** * Name: <NAME> & <NAME> * * CPSC 335-01 13115 * * Date: 04/20/2016 * *****************...
/* * File: DictFormatter.cpp * Author: opiske * * Created on May 11, 2015, 5:55 PM */ #include "DictFormatter.h" using namespace dtests::common; DictFormatter::DictFormatter() : super() { } DictFormatter::DictFormatter(const DictFormatter& orig) : super() { } DictFormatter::~DictFormatter() { } ...
// 48. Rotate Image [Medium] // You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). // Note: You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. // DO NOT allocate another 2D matrix and do the rotation. // Example 1: // G...
// This is the CPP file you will edit and turn in. // Also remove these comments here and add your own. // TODO: remove this comment header! #include <cctype> #include <cmath> #include <fstream> #include <iostream> #include <sstream> #include <string> #include "console.h" #include "filelib.h" #include "gri...
/* * Copyright (c) 2018 https://www.thecoderscorner.com (Nutricherry LTD). * This product is licensed under an Apache license, see the LICENSE file in the top-level directory. */ #include <PlatformDetermination.h> #include "MenuItems.h" #include "tcMenu.h" #include "MenuIterator.h" #include "BaseRenderers.h" MenuI...
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2019, WVU Interactive Robotics Laboratory * https://web.statler.wvu.edu/~irl/ * All rights reserved. * * Redistribution and use in source and binary forms, with or w...
/* +------------------------------------------------------------------------+ | Mobile Robot Programming Toolkit (MRPT) | | https://www.mrpt.org/ | | | | Cop...
#include <iostream> #include <string> #include <sstream> #include <vector> #include "toyfs.hpp" using std::cerr; using std::cin; using std::cout; using std::endl; using std::getline; using std::istringstream; using std::make_shared; using std::shared_ptr; using std::string; using std::vector; const string PRMPT = "sh...
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <unordered_map> using namespace std; struct Node { int left; int right; long long value; }; int a[500000]; Node tree[500000]; struct rmq { private: static int pow2(int n) { int res = 1; while (res < ...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. #include "pch.h" #include "WslDistroGenerator.h" #include "LegacyProfileGeneratorNamespaces.h" #include "../../types/inc/utils.hpp" #include "../../inc/DefaultSettings.h" #include "Utils.h" #include <io.h> #include <fcntl.h> #inc...
#include "globals.hpp" #include <pcl/visualization/cloud_viewer.h> #include <pcl/octree/octree_pointcloud_adjacency.h> #include <pcl/features/normal_3d_omp.h> #include <exercices_toolbox.h> #include <opencv2/opencv.hpp> #include <pcl/filters/voxel_grid.h> #include <pcl/kdtree/kdtree_flann.h> #include <opencv2/imgproc/t...
// license:BSD-3-Clause // copyright-holders:<NAME>, <NAME> /********************************************************************************** Fun World / Amatic / TAB / Impera. Series 7000 hardware. Video Hardware. Written by <NAME>. *************************************************************************...
#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <signal.h> #include <sys/types.h> #include <unistd.h> #include <sys/ipc.h> #include <sys/shm.h> #define MAX_BUF_SIZE 5 #define KEY_CODE 42 using namespace std; vector<int> buffer; vector<int> primes; void prime_gen(int n) ...
//******************************************************************************** // Copyright (c) 2007-2013 Intel Corporation. All rights reserved. ** // ** // Redistribution and use in source and binary forms, with or withou...
/** * @file undirected_graph.cpp * @brief Class of undirected graphs * @author <NAME> * @date 2022-01-23 * @copyright MIT License */ #include <iostream> #include <vector> #include <map> #include <queue> #include <stack> #include <utility> namespace nrs { class undirected_graph { public: typedef st...
//----------------------------------------------------------------------------- // File : KpixThreshRead.h // Author : <NAME> <<EMAIL>> // Created : 10/27/2008 // Project : SID Electronics API //----------------------------------------------------------------------------- // Description : /...
// Copyright 2016 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 <memory> #include <string> #include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/run_loop.h" #include "base/test/f...
// // Copyright © 2016 Project Mahjong. 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 <fstream> #include "config_generated.h" #include "character_generated.h" #include "jonoondb/jonoondb_api/database.h" using namespace std; using namespace flatbuffers; using namespace jonoondb_api; using namespace jonoondb_tutorial; string ReadFile(const string& path, bool isBinary = true...
/**************************************************************************** * * Copyright (c) 2017 PX4 Development Team. 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. Redistri...
/* * Copyright 2022 Google LLC * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "include/core/SkData.h" #include "include/core/SkRefCnt.h" #include "include/core/SkString.h" #include "include/private/SkSLProgramKind.h" #include "src/core/SkOSFile....
// Copyright (c) 2021 Beijing Xiaomi Mobile Software 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 ...
/* Copyright [2008] [<NAME>] 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 "pch.h" #include "TextureManager.h" //../[Lib]__Engine/Sources/DxCommon #include "DxRenderStates.h" #include "cursor.h" #ifdef _DEBUG #define new DEBUG_NEW #endif CCursor& CCursor::GetInstance() { static CCursor Instance; return Instance; } CCursor::CCursor(void) : m_bGameCursor(TRUE), m_emType(CURSO...
#include "utils.h" #ifdef Q_OS_WIN #include <Windows.h> #include <winreg.h> #endif //Q_OS_WIN #ifdef Q_OS_MAC #include <IOKit/IOBSD.h> #include <IOKit/IOKitLib.h> #include <IOKit/storage/IOMedia.h> #endif //Q_OS_MAC QByteArray Utils::protocol_version_signature = QByteArray(); QString Utils::protocol_version_signatur...
#include "QtPlugin.h" #include "Configuration.h" #include "Data/CharacterDB.h" #include "Data/EntityDB.h" #include "Data/GameManager.h" #include "Data/LevelGen.h" #include "Data/Online.h" #include "Data/ParticleDB.h" #include "Data/SaveGame.h" #include "Data/State.h" #include "Data/StringsTable.h" #include "Data/Textur...
// Copyright 2020 Makani Technologies 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 ...
/* * Author: <NAME> * * A program that illustrates intersectConvexConvex in various scenarios */ #include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" using namespace cv; using namespace std; // Create a vector of points describing a rectangle with the given corners static vector<Point> makeRectangle(Poi...
/* * Copyright 2006 - 2018, <NAME> * * 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 agr...
#include "planning/body.hh" #include "logging/assert.hh" #include "numerics/numdiff.hh" #include "viewer/primitives/simple_geometry.hh" #include "viewer/window_3d.hh" // // - Fix yaw // - Draw a uniformly sampled (in output) yaw transfer // - Write golden-section method + quadratic interpolation linesearch na...
/* * * Copyright 2015 gRPC 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 agree...
#include "imu.h" #include <math.h> #include <BadgeOs.h> #include <BadgeApp.h> #include <BadgeMenu.h> #include <BSidesBadge2020.h> #include <display.h> #include <menu.h> #include <SixAxisMotionDriver.h> BadgeApp imu_app; #ifdef ESP32 static SixAxisMotionDriver imu(ESP32_I2C_IMU_ADDR); static uint8_t backup_display_mo...
/* * Hedgewars, a free turn based strategy game * Copyright (c) 2004-2014 <NAME> <<EMAIL>> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License * * This program is ...
#include <algorithm> #include <cassert> #include <cstdio> #include <iostream> #include <sstream> #include <string> #include <vector> #include <cstring> #include <utility> using namespace std; class MixingLiquids { public: double howMuch(vector <int> percent, vector <int> amount, int need) { vecto...
#include "llvm/IR/Instructions.h" #include "llvm/IR/IRBuilder.h" #include "InstructionMixAnalysis.h" #include "Transformations.h" #include <cmath> using namespace llvm; /**** ShlToMul ****/ ShlToMul::ShlToMul() : Transformation() { usageChange[FuncUnit::Shift] = -1; usageChange[FuncUnit::IntMul] = 1; } void S...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.cpp * Author: Adrian * * Created on 29 de septiembre de 2020, 19:55 */ #include <cstdlib> #include <iostream>...
#include "seller.h" //The constructor also creates the objects thread. Seller::Seller(std::string auditorium[10][10], std::string type, int N) { //generate buyers for(int i = 0; i < N; i++) { Buyer b; createBuyer(&b, i); this->buyerQueue.push(b); } this->auditorium = auditorium; this->type = type; th...
/*M/////////////////////////////////////////////////////////////////////////////////////// // // This is a test file for the function decomposeHomography contributed to OpenCV // by <NAME>. // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or usin...
#include "std.h" extern "C" { #include <libavutil/imgutils.h> #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscale/swscale.h> } #include <opencv2/opencv.hpp> #include <opencv2/core.hpp> #include <opencv2/core/utility.hpp> #include <opencv2/highgui.hpp> int fcounter = 0; void on_fra...
// Copyright (c) 2018-2019 <NAME> and <NAME>, Inc. // 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) // This is the program presented in https://zajo.github.io/leaf/#introduction-eh. // It reads a text file in a bu...
#include <cstdio> #include <vector> #include <algorithm> #include <queue> using namespace std; typedef pair<int,pair<int,int> > Tri; bool moze(int c1,int f1,int w1,int c2,int f2,int w2) { if(c2-max(w2,f2)<50) return false; if(c2-max(w1,f1)<50) return false; if(c1-max(w2,f2)<50) return false; return true; } i...
/* PROBLEM: Euler 73 How many fractions lie between 1/3 and 1/2 in the sorted set of reduced proper fractions for d ≤ 12,000? SOLUTION: SOLUTION 1: The idea is to generate candidates: $\frac{k - m}{2k + n}$ where $k$ is in the range $\{1, 2, \cdots, N_{Max} / 2\}$. Also, $m$ and $n$ has to satisfy $...
#include <boost/asio.hpp> #include <boost/bind.hpp> #include <istream> #include <iostream> #include <ostream> #include <vector> #include "icmp_header.hpp" #include "ipv4_header.hpp" using boost::asio::ip::icmp; using boost::asio::deadline_timer; namespace posix_time = boost::posix_time; class TimeSynchronizer { publ...
#include "object_matrix.h" #include "object_factory.h" #include <iostream> #include <fstream> ObjectMatrix::ObjectMatrix() : is_star_{ 0 }, mt(rd()) { InitProb(); height_ = kMatrixHeight / (kObjectLength + kSpaceBetweenObject); width_ = kWindowWidth / (kObjectLength + kSpaceBetweenObject); std::cout << height_...
#include "PyJacobi_Solver.h" #include <math.h> #include <iostream> //#include "WorkArounds.h" #include "omp.h" PyJacobi_Solver::PyJacobi_Solver(const int N) : u_out(NULL), u_even(NULL), u_odd(NULL), N(N), maxIter(0), tolerance(0),exit_code(0),numIter(0),rhs(0) { } PyJacobi_Solver::~PyJacobi_Solver() { const int N =...
//===- CodeMoverUtils.cpp - CodeMover Utilities ----------------------------==// // // 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 // //===---------------------------...
// <NAME> // SimilarityMatrix.cpp #include <cstring> #include <chrono> #include <iterator> #include <sstream> #include "SimilarityMatrix.h" Score MaxScore(const std::vector<Score> &scores) { Score best{None, 0}; for (auto score : scores) { if (score.Value > best.Value) { best = {score.dire...
#include <gtest/gtest.h> #include <rpc/server/server.hpp> namespace rvision::rpc { class client_2 { public: client_2(std::shared_ptr<rvision::core::logger> logger, std::shared_ptr<grpc::Channel> channel) : _logger(logger), _stub(SportLinesService::NewStub(channel)), _status(grpc::Status::OK) { _processin...
#include "BloomFilter.h" BloomFilter::BloomFilter(uint64_t size, uint8_t numHashes) : m_bits(size), m_numHashes(numHashes) { m_compressedData = new unsigned char[size]; } BloomFilter::~BloomFilter(){// and do not forget to delete it later delete[] m_compressedData;} std::array<uint64_t, 2> hash(...
/* This file provides the interface to Mablab. Alternatively you could use lewenstein.hpp directly from your own C++ code. Compilation for Ubuntu/Octave: # apt-get install liboctave-dev build-essential # CPPFLAGS="-fopenmp -O3 -ansi" LDFLAGS="$CPPFLAGS" mkoctfile -lgomp --mex hhgmax_lewenstein.cpp notes: * opt...
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follow...
//===- TestFinalizingBufferize.cpp - Finalizing bufferization ---*- C++ -*-===// // // 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 // //===---------------------------...
#include <iostream> #include <vector> #include <fstream> #include <algorithm> #include <map> #include <queue> #include <string> /* knapsackSolver */ typedef struct Item { float weight; int value; int Index; } Item; // Node structure to store information of decision // tree typedef struct Node { // level --> ...
// Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich) // 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 co...
/** * 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, software * distributed unde...
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <vector> #include <math.h> #include "fastmath.h" #include "Vec2.h" #include "geom2D.h" #include <SDL2/SDL.h> #include <SDL2/SDL_opengl.h> #include "Draw2D.h" #include "AppSDL2OGL.h" #include "TerrainCubic.h" #include "TiledView.h" constexpr int...
/* * Copyright (c) 2019 Dell 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 * * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARR...
/* BSD 2-Clause License Copyright (c) 2020, <NAME> 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 retain the above copyright notice, this list of conditions a...
//{ #include<bits/stdc++.h> using namespace std; typedef int ll; typedef double lf; typedef pair<ll,ll> ii; #define REP(i,n) for(ll i=0;i<n;i++) #define REP1(i,n) for(ll i=1;i<=n;i++) #define FILL(i,n) memset(i,n,sizeof i) #define X first #define Y second #define SZ(_a) (int)_a.size() #define ALL(_a) _a.begin(),_a.end(...
#include "dragoncello.h" void DRAGONCELLO::buildXGrid() { cout << "x in " << xmin / kpc << " ... " << xmax / kpc << " kpc" << endl; deltax = (xmax - xmin)/(nx-1); for (int ix=0; ix<nx; ix++) { x_vec.push_back(xmin + ix * deltax); } ixsun = lower_bound(x_vec.begin(), x_vec.end(), x_Sun) - x_vec.begin(); for ...
/* * Copyright (C) 2013-2021 Intel Corporation. * SPDX-License-Identifier: MIT */ // This application verifies that Pin sets up the signal handler stack with proper alignment on IA32. // The compiler expects "esp+4" to be 16-byte aligned on entry to the signal handler function. // We use a movaps instruction, which...
#include "SimG4Core/CustomPhysics/interface/CMSSIMPInelasticProcess.h" #include "SimG4Core/CustomPhysics/interface/CMSSIMPInelasticXS.h" #include "SimG4Core/CustomPhysics/interface/CMSSIMP.h" #include "G4Types.hh" #include "G4SystemOfUnits.hh" #include "G4HadProjectile.hh" #include "G4ElementVector.hh" #include "G4Tr...
/******************* Project_rubik.cpp ******************* || Author : <NAME> || || Supervisor : Dr. <NAME> || || Email : <EMAIL> || *********************************************************/ // ___Include Libraries___ #include <iostream> #include <iomanip> #inclu...
/* * ParamManager.cpp * * Created on: 22 Oct 2014 * Author: fgz73762 */ #include "ADDriverEx.h" #include "AsynParam.h" #include "AsynException.h" #include "TakeLock.h" #include <sstream> // Constructor. ADDriverEx::ADDriverEx(const char* portName, int numAddresses, int maxBuffers, size_t maxMemory) : ADDri...
#include "SMmeshPool.h" void SMmeshPool::createDefaultMaterial(std::string name) { SMmaterial defmaterial; defmaterial.texRef = createDefaultTexture(defmaterial.texID); defmaterial.name = name; defmaterial.texName = name; materials.push_back(defmaterial); } int32_t SMmeshPool::createDefaultTexture(int32_t &texID...
/* ------------------------------------------------------------------------------------------------- * * CPU THREAD AFFINITY HELPER * ========================== * * This file: * cpu_affinity_util test driver for C++ as header-only * * Authors: * <NAME> * * Releases: July 29 2021 - v0.1 * v0.1 - July 2021 - in...
/* * VERSION: SCS-1.0.1 * DATE: 2013.Sep.1 * AUTHOR: <NAME> */ #include <stdio.h> #include <malloc.h> #include <math.h> #include <ode/ode.h> #include "common.h" #include "vector.h" sVector::sVector () { x = 0.0; y = 0.0; z = 0.0; CalcLen (); } sVector::sVector (double x, double y, d...
#include "GameManager.h" #include <stdlib.h> #include <time.h> bool GameManager::in(int low, int value, int high) { return (low <= value) && (value <= high); } void GameManager::printEmoji(const std::wstring& str) { #ifdef _WIN32 addrawch(str[0]); #else char dst[11]; wcstombs(dst, str.d...
template <typename T> constexpr LogLevel LoggerStreamModifiers::modifierToLogLevel() { if constexpr (std::is_same_v<T, LoggerStreamModifiers::verbose>) { return LogLevel::Verbose; } if constexpr (std::is_same_v<T, LoggerStreamModifiers::info>) { return LogLevel::Info; } if constexpr (std::is_same_v<...
// 2017 <NAME> /*! \file solvent_config_handler.h */ #include <cmath> /**> cubic root */ #include <stdexcept> #include "../include/solvent_config_handler.h" #include "../include/default_macros.h" SolventConfigHandler::SolventConfigHandler(double solvent_sigma, double density, int nc, ...
#include "Communication.h" // LB_SERIAL_DEVICE_DIR : socatでデバイスが作られるディレクトリ // LB_SOCAT_DIR // LB_AYAME_SIGNALINGKEY // LB_AYAME_ROOM_ID // LB_MOMO_DIR // 環境変数として以上を設定する Communication::Communication() { if (char *temp = getenv("LB_SERIAL_DEVICE_DIR")) { this->serial_device_dir = std::string(temp); } els...
/* Copyright 2001, 2019 IBM Corporation * * 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 of conditions and the * following d...
// ResTbl.cpp // // Copyright (c) 1994-2020 By <NAME>, All Rights Reserved. // // 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 righ...
/**************************************************************************** Copyright 2021 <NAME> 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 ...
/** *================================================================== * Copyright (C) 2018 FMTech All Rights Reserved. * * @author Drew.Chiang * * @email <EMAIL> * * @create_date 2018/7/14 21:28 * *================================================================== */ #include "FFmpegVideo.h" static voi...
#include <xmpp/biboumi_component.hpp> #include <utils/timed_events.hpp> #include <network/poller.hpp> #include <config/config.hpp> #include <logger/logger.hpp> #include <utils/xdg.hpp> #include <utils/reload.hpp> #ifdef CARES_FOUND # include <network/dns_handler.hpp> #endif #include <atomic> #include <signal.h> // A...
#include <libcaercpp/devices/davis.hpp> #include <atomic> #include <csignal> #include <fstream> #include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <boost/filesystem.hpp> #include <boost/program_options.hpp> static std::atomic_bool global...
#include <stdlib.h> #include <string.h> #include <stdio.h> #include <fcntl.h> #include <sys/stat.h> #include "net/internet/http/logger.h" net::internet::http::logger::logger() : _M_file(-1) { *_M_dir = 0; memset(&_M_time_prev_log, 0, sizeof(struct tm)); } bool net::internet::http::logger::create(const char* dir) {...
#include "gfa/group.h" #include "gfa/graph.h" enum GfaGroupResolveStatus { GFA_GROUP_UNRESOLVED, GFA_GROUP_RESOLVING, GFA_GROUP_RESOLVED }; GfaGroup::GfaGroup() : GfaReferenceableLine(GFA_GROUP) { resolve_status = GFA_GROUP_UNRESOLVED; members.reserve(2); } GfaGroup::~GfaGroup() { } void GfaGroup::delet...
/* * 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...
// Modified and added to the TPIE distribution in April 2003 by // <NAME> <<EMAIL>> /* getopts.cpp - Command line argument parser * * Whom: <NAME> <<EMAIL>> * Date: 20010111 * Why: Because I couldn't find one that I liked. So I wrote this one. * */ /* * Copyright (c) 2001, 2002, <NAME> <<EMAIL>> * All rights ...
#include "TablaHash.h" #include "Pagina.h" #include <list> #include <iostream> using namespace std; TablaHash::TablaHash(){ nElem = 0; /* Tamaño inicial de la lista: Lo inicializaremos en la tercera parte del número de elementos aproximado que tiene el archivo de entrada de prueba del Mooshak -> 18000 aprox / 3 ...
#include "base.h" Agent::Agent(Economy* economy) : economy(economy), money(0), time(economy->get_time()) { inventory = Eigen::ArrayXd::Zero(economy->get_numGoods()); } Agent::Agent( Economy* economy, Eigen::ArrayXd inventory, double money ) : economy(economy), inventory(inventory), money(money), time(economy...
#include <sirius.h> using namespace sirius; void test_hloc(std::vector<int> mpi_grid_dims__, double cutoff__, int num_bands__, int reduce_gvec__, int use_gpu__, int gpu_ptr__) { device_t pu = static_cast<device_t>(use_gpu__); MPI_grid mpi_grid(mpi_grid_dims__, mpi_comm_world()); matr...
#include "common.hh" #include "DBFactories/TupleFactory.hh" #include "Domain.hh" #include "Relation.hh" #include <sstream> #include <ext/hash_map> // #include "RelationVisitor.hh" #include "../relationTranslatorGenerator/output/RelationVisitor.hh" #include "CFGVisitor.hh" #include "ChildVisitor.hh" DBFactory *db; Doma...
#include <QCoreApplication> #include <QStringList> #include <QFile> #include <QDir> #include <QImage> #include <QDateTime> #include <QRegularExpression> #include <QDebug> #include "exif.h" QString readExifDate(QString fileName) { QString dateStr; QByteArray blob; unsigned char* buf; EXIFInfo result; QFile file(f...
#include <iostream> #include <fstream> #include <cstdlib> #include <string> #include <cstring> #include <cmath> #include <sys/time.h> #include <algorithm> using namespace std; int maxK = 3; int maxN = 26; int filenum = 0; float timeRemaining = 300; struct timeval timeval1; struct timeval timeval2; double time1; doubl...
#pragma once /* This file is part of Imagine. Imagine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Imagine is distributed in the ...