text
stringlengths
3.08k
12.5k
#include <stdio.h> #include <string> #include <vector> #include <algorithm> #include <assert.h> using std::string; using std::vector; using std::sort; const int MEM_SIZE = 16; // 16 bytes(hold 4 integers) const string filename = "data/exteral_sorting.dat"; typedef struct { int* base; int num; int idx; } mem_p...
/* 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/. */ // OS/2 plugin-loading code. #define INCL_DOS #define INCL_DOSERRORS #include <os2.h> #include "nsPluginsDir.h" ...
//------------------------------------// // Author: <NAME> // // Date: 2020-11-19 // // SCC0650 - Computação Gráfica (2020)// //------------------------------------// #include "server.hpp" #include "defines.hpp" #include "helpers/log.hpp" #include <iostream> Server::Server(): _maxClients(20) ...
/** * @file gameManager.inl * @version 1.0 * @since May, 26. * @date Jun, 01. Map * @author <NAME> (<EMAIL>) * @author <NAME> (<EMAIL>) * @title Game Manager source code */ #include "gameManager.hpp" Game game; /** @brief Verifies if there is any error in the board. @return The finded error, if exists. *...
/** * @file * @brief Implementation of module * * @copyright Copyright (c) 2017-2020 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 applying this license, CERN does not waive the privileges and immunities grant...
#include <rrt_planners/planners/simple/SimpleRRT.h> //#define PRINT_STATISTICS false RRT::SimpleRRT::SimpleRRT() : Planner() { // maxRange_ = 0.5; // steering_ = new Steering(space_, maxRange_); } RRT::SimpleRRT::~SimpleRRT() { } RRT::State* RRT::SimpleRRT::steer(State* fromState, State* toState, std::vector...
#include "PlayerCtrl.h" #include "AnimationMSG.h" #include "PhysicsMSG.h" PlayerCtrl::PlayerCtrl(MSGreciever *firstListener, SDL_Event *Evnt, int idnum,ID physix) : Movement(Move::Idle), event(Evnt), test() { m_Mine = ID(idnum, OBJTYPE::GameOBJ,GOTYPE::Player); m_Target = ID(idnum, OBJTYPE::Sprite); m_mailma...
/* Copyright (c) 2015, The Measurement Factory. */ #include <iostream> #include <sstream> #include <limits> #include <cassert> #include <cstdlib> #include <stdint.h> /* Based on HPAC draft-ietf-httpbis-header-compression-10, Section 5.1 */ // XXX: The interface will change. // TODO: Transform into Connection::sendIn...
/*This file is part of the FEBio source code and is licensed under the MIT license listed below. See Copyright-FEBio.txt for details. Copyright (c) 2020 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 person obtaining ...
//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURP...
/* * ============================================================================ * * Filename: mpg-burnin.cc * Description: markov process with burnin * License: GPLv3+ * Author: <NAME>, <EMAIL> * * ============================================================================ */ #...
// Copyright (c) 2017, Lawrence Livermore National Security, LLC and // UT-Battelle, LLC. // Produced at the Lawrence Livermore National Laboratory and the Oak Ridge // National Laboratory. // LLNL-CODE-743438 // All rights reserved. // This file is part of MGmol. For details, see https://github.com/llnl/mgmol. // Plea...
#include "IA.hpp" #include "improc/RoadDetection.hpp" #include "improc/RoadDetectionThread.hpp" #include "improc/UserDetection.hpp" #include "improc/UserDetectionThread.hpp" #include "car/MotorDiagnostic.hpp" #include "car/Obstacle.hpp" #include "sound/Sound.hpp" #include "utils/Log.hpp" #include <chrono> #include <thr...
// Copyright 2021 The Dawn 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 t...
/* * Copyright (C) 2009-2021 Intel Corporation. * SPDX-License-Identifier: MIT */ /* * Sample buffering tool * * This tool collects an address trace of instructions that access memory * by filling a buffer. When the buffer overflows,the callback writes all * of the collected records to a file. * */ #includ...
// Here we define some functions to load PlanIM images #include "PlanIM_Functions.h" #include <iostream> using std::cout; using std::endl; extern void loadPlanIM_reg( Array3D<float>& image3D, const plan_im_header& header, const PIXELTYPE* scans,double* temp_scale, ...
#include "Matrix.h" Matrix::Matrix() { unit(); } Matrix& Matrix::operator*=(const Matrix& other) { Matrix m; m.data[0] = data[0] * other.data[0] + data[4] * other.data[1] + data[8] * other.data[2] + data[12] * other.data[3]; m.data[1] = data[1] * other.data[0] + data[5] * other.data[1]...
#include "geneticProgramming.h" #include "grammar.h" #include "treePrinter.h" #include "treeEvaluator.h" #include "rampedHalfAndHalfInitializer.h" #include <iostream> #include <sstream> #include <cassert> using namespace genetic; using namespace grammar; namespace { // The functions that we're trying to find. int f0...
#include "NetworkService.h" #include "Daemon.h" #include "Responses.h" #include "ZHelpers.h" #include "DatabaseHandle.h" [[noreturn]] static void *worker_thread(void *arg) { auto *wctx = static_cast<WorkerContext *>(arg); zmq::context_t context(1); zmq::socket_t worker(context, ZMQ_REQ); worker.sets...
// Sequential version of CG // Author: <NAME> #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <math.h> #include"Util.h" #include"ConjugateGradientCpu.h" #include <fstream> #include<iostream> #define TOL 0.001 using namespace std; /* * Computes a (square) matrix vector product * Input: pointer t...
#include "Dodec.h" #include "Vecteur3D.h" #include "Plan.h" #include "Dalle.h" #include "Obstacle.h" #include <cmath> #include <vector> #include <memory> using namespace std; unique_ptr<Dodec> Dodec:: cloneMe() const { return unique_ptr<Dodec>(new Dodec(*this)); } unique_ptr<Obstacle> Dodec:: copie() const { ...
#include "ActionTextKeys.hpp" #include "ChatAction.hpp" #include "Commands.hpp" #include "Conversion.hpp" #include "CreatureProperties.hpp" #include "CurrentCreatureAbilities.hpp" #include "Game.hpp" #include "GameUtils.hpp" #include "MessageManagerFactory.hpp" #include "RNG.hpp" #include "TextFormatSpecifiers.hpp" us...
/*------------------------------------------------*/ // Uva Problem No: 11107 // Problem Name: Life Forms // Type: Suffix Trie, Tree, Array (String Processing) // Autor: <NAME> // Data: 2017-10-02 01:54:01 // Runtime: 0.540s // Universidade: Unicamp /*------------------------------------------------*/ #include <bits/s...
// Copyright 2021 <NAME> #include "IRrecv.h" #include "IRsend.h" #include "IRutils.h" /// @file /// @brief Arris "Manchester code" based protocol. /// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1595 // Supports: // Brand: Arris, Model: VIP1113M Set-top box // Brand: Arris, Model: 120A V1.0 A18 ...
#include "double_pendulum.hpp" #define G 9.81 // Gravitational constant #define SQR(x) ((x) * (x)) // Initialize pendulum parameters DoublePendulum::DoublePendulum(double m1, double m2, double l1, double l2, double th1, double th2) { SetMasses(m1, m2); SetLengths(l1, l2); ...
#include "HeaderFiles/KeyHelper.h" #include "HeaderFiles/Constants.h" struct Key { int id; bool isPositionKey; bool isRotationKey; bool isScaleKey; bool isVisibleKey; Vector3 position; Quaternion rotation; Vector3 scale; bool isVisible; Key() { id = -1; ...
#include "editorstate.h" #include <unistd.h> #include "gameobjectarray.h" #include "graphicsmanager.h" #include "gamestate.h" #include "playingstate.h" #include "gameobject.h" #include "player.h" #include "mapfile.h" #include "room.h" #include "roommap.h" #include "camera.h" #include "string_constants.h" #include "s...
/* The zlib/libpng License Copyright (c) 2005 <NAME> (pjcast -- www.wreckedgames.com) 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...
#include "tensor_client.h" #include <random> #define DebugErrorMessage(tag, status) \ do { \ std::cout << tag << ": " << __FILE__ << "," << __LINE__ << std::endl; \ std::cout << "Error Co...
#include "exact.h" const byte nStates = 2; // {false, true} const size_t nNodes = 4; // four students void CExact::fillGraph(CGraph *graph) { Mat nodePot(nStates, 1, CV_32FC1); // node Potential (column-vector) Mat edgePot(nStates, nStates, CV_32FC1); // edge Potential (matrix) // Setting the node ...
#include "gurka.h" #include <gtest/gtest.h> using namespace valhalla; class IncludeConstructionTest : public ::testing::Test { protected: static gurka::nodelayout layout; static gurka::ways ways; static void SetUpTestSuite() { const std::string ascii_map = R"( A---------B--------C ...
/* This file is part of cpp-ethereum. cpp-ethereum 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. cpp-ethereum is distributed in the...
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: #ident "$Id$" /*====== This file is part of PerconaFT. Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. PerconaFT is free software: you can redistribute it and/or modif...
// // Created by <NAME> on 10/13/17. // #include "testingconfiguration.h" #include <iostream> #include <memory> #include "harmonicpotential.h" #include "gmxapi/context.h" #include "gmxapi/md.h" #include "gmxapi/session.h" #include "gmxapi/status.h" #include "gmxapi/system.h" #include "gromacs/utility/classhelpers....
#include "Simulator.h" #include <algorithm> #include <cmath> #include <iostream> #include "constants.h" #include "Kernels.h" #include "Model.h" #include "GlobalMatrices.h" double determineTimestep(double hx, double hy, Grid<Material>& materialGrid) { double maxWaveSpeed = 0.0; for (int y = 0; y < materialGrid.Y(...
#include <bits/stdc++.h> #define ll long long #define ls id << 1 #define rs id << 1 | 1 #define mem(array, value, size, type) memset(array, value, ((size) + 5) * sizeof(type)) #define memarray(array, value) memset(array, value, sizeof(array)) #define pb(x) push_back(x) #define st(x) (1LL << (x)) #define pii pair<ll, in...
#include <opencv2/core.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/features2d.hpp> #include <opencv2/highgui.hpp> #include "RobustFeatureMatching.hpp" #include <iostream> cv::Mat stichImages (cv::Mat imgInput1, std::vector<cv::Point2f> &inlierPoints1, cv::Mat imgInput2, std::vector<cv::Point2f> &inlierPoi...
/* mbed Microcontroller Library * Copyright (c) 2015 ARM Limited * * 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 * * Unles...
#include <bits/stdc++.h> using namespace std; typedef struct { int id; int solved; int penalty; } team; bool icpc_cmp(team a, team b) { if (a.solved != b.solved) // can use this primary field to decide sorted order return a.solved > b.solved; // ICPC rule: sort by number of problem solved else if (a.p...
#include "test/wasm.h" #define WIDTH 256 #define HEIGHT 256 typedef unsigned char byte; unsigned int buffer[WIDTH * HEIGHT]; static unsigned int f2b(float value) { if (value < 0.0f) { value = 0.0f; } if(value > 1.0f) { value = 1.0f; } return (int)(value * 255); } // Convert a linear color value ...
/*** Gauss-Jordan Elimination n = number of linear equations m = number of variables ar[i][m] = right-hand side value of constants For instance, the system of linear equations becomes: 2x + y -z = 8 -----> (i) -3x -y + 2z = -11 -----> (ii) -2x + y + 2z = -3 -----> (iii) n = 3 (x, y, z), m = 3 (i, ii, ii...
#include <functional> #include <string> #include <signal.h> #include "common.h" #include "tools.h" #include "vMI_module.h" /** * Controls I/O for an entire ip2vf module. * A module is an entity which can handle multiple inputs and produces a single output. * This version of the API does NOT support multiple output i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define oo 666666666 const int N = 100001; int chain[N],head[N],P[N],D[N],sz[N],segID[N],nxtChain=1,nxt=1,n; int E[N][3];//edges int seg[4*N]; vector<int>G[N]; int dfs(int c)//sets node parents, depths, subtree sizes { sz[c]...
//===- ConvertSwapChannel.cpp - convert Conv2D----------------------------------===// // // 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:/...
#include <osmium/handler.hpp> #include <osmium/io/pbf_input.hpp> #include <osmium/visitor.hpp> #include <osmium/osm/item_type.hpp> #include <string> #include "rapidjson/writer.h" #include "rapidjson/stringbuffer.h" #include <boost/filesystem.hpp> #include <fstream> #include <unordered_map> #include <unordered_set> #inc...
// shiolab_loaders.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #include <stdlib.h> #include <memory.h> #include <assert.h> #include <vector> #include <list> #include <map> #include <functional> #include <sstream> #include <algorithm> #include <eccodes.h> class ScopeGuard { pu...
#include <algorithm> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #include <cassert> #include <climits> #inclu...
#include <cv_bridge/cv_bridge.h> #include <math.h> #include <ros/publisher.h> #include <ros/ros.h> #include <sensor_msgs/Image.h> #include <std_msgs/Bool.h> #include <opencv2/opencv.hpp> // Determines when the start light changes from red to green ros::Publisher debug_img_pub; ros::Publisher bool_pub; sensor_msgs::I...
/* * This file is a part of the Classp parser, formatter, and AST generator. * Description: main() and some helper functions. * * Copyright 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a c...
// Larbin // <NAME> // 27-05-01 -> 04-01-02 #include <string.h> #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <iostream.h> #include "types.h" #include "global.h" #include "utils/mypthread.h" #include "utils/PersistentFifo.h" PersistentFifo::PersistentFifo ...
// Fill out your copyright notice in the Description page of Project Settings. #include "ShipBuildingDemo.h" #include "ShipPartFactory.h" #include "ShipPart.h" DECLARE_LOG_CATEGORY_CLASS(LogShipPartFactory, Log, All); namespace { // Gets the directory name of a file. static FString DirName(const FString& InPath) ...
// __BEGIN_LICENSE__ // Copyright (C) 2006-2010 United States Government as represented by // the Administrator of the National Aeronautics and Space Administration. // All Rights Reserved. // __END_LICENSE__ // TestDisparity.h #include <gtest/gtest.h> #include <vw/Stereo/DisparityMap.h> #include <vw/Image/ImageView...
#include <string> #include <vector> // Ros #include "ros/ros.h" #include "std_msgs/String.h" #include "std_msgs/Bool.h" #include "std_srvs/Trigger.h" #include "geometry_msgs/PoseStamped.h" #include "geometry_msgs/Pose.h" // Custom messages #include "trader/Task.h" #include "trader/announcement.h" // Custom services #in...
/* Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved */ #include <assert.h> #include "GaussianExponentialFit.h" #include "Utils.h" #include "RegionTimingCalc.h" void FindStartingParametersForBkgModel(GaussianExponentialParams &my_initial_params, float &my_fit_residual, float *avg_sig, int avg_len){ ...
#include <Rcpp.h> #include <math.h> // isinf() is in math.h using namespace Rcpp; // forward declarations --------------------------------------------------- NumericMatrix discretize_vectors_cpp(NumericVector x, NumericVector y, NumericVector dims, NumericVector x_range, NumericV...
#include "camera.h" Camera::Camera(float positionX, float positionY, float positionZ, float pitch, float yaw) { this->uniform = { .position = { 0, 0, 0, 1 }, .right = { 1, 0, 0, 0 }, .up = { 0, 1, 0, 0 }, .forward = { 0, 0, 1, 0 }, .pitch = 0, .yaw = 0...
/* Author <NAME> */ #include <iostream> #include <stdlib.h> #ifdef __arm__ #include <raspicam/raspicam_cv.h> using namespace raspicam; #endif #include <opencv2/opencv.hpp> #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" using namespace std; using namespace cv; void help(){ cout << ...
#include <csignal> #include <iostream> #include <pngwriter.h> #include <cli/cli.h> #include <experimental/filesystem> namespace fs = std::experimental::filesystem; class Shape { public: virtual void draw(pngwriter &writer) = 0; virtual ~Shape(){}; }; class Rectangle : public Shape...
// --------------------------------------------------------------------------- // // The general purpose cross platform C/C++ framework // // S x A c c e l e r a t e // // Home: https://www.sxlib.de // License: Apache 2 // Authors:...
/* Code for Huffman Encoding and Decoding by <NAME> Kunal For CS 254 Project */ #include<bits/stdc++.h> #include<stdio.h> using namespace std; map<char,string> final; unsigned char addCodeToBuffer(vector<int> code, FILE *fp, unsigned char buffer, int *bufferSize) { // writes code in buffer and write it in encoded file...
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long ll; const ll inf = 0x3f3f3f3f3f3f3f3f; struct Point { ll x, y; Point (ll x = 0, ll y = 0): x(x), y(y) {} }; ll Dis (Point a, Point b) { ll x = a.x - b.x; ll y = a.y - b.y; return x * x + y * y; } ll solve (int L, i...
#include "SuperFastSkimmer.hh" SuperFastSkimmer::SuperFastSkimmer(const TString & cutflowconfig, const TString & infilename, const Bool_t issignalfile, const TString & outtext) : fCutFlowConfig(cutflowconfig), fInFileName(infilename), fIsSignalFile(issignalfile), fOutFileText(outtext) { std::cout << "...
/* * scene.cpp * * Created on: Nov 14, 2014 * Author: kenaco */ #include <assimp/scene.h> #include <string> #include "log.hpp" #include "exceptions.hpp" #include "scene.hpp" #include "util.hpp" using namespace std; void Scene::load_meshes(aiNode* node, glm::mat4 modelMatrix) { for (unsigned int i=0; i ...
// //////////////////////////////////////////////////////// // # Title // Optimum polynomial // // # URL // https://projecteuler.net/problem=101 // http://euler.stephan-brumme.com/101/ // // # Problem // If we are presented with the first `k` terms of a sequence it is impossible to say with certainty the value of the n...
#include "axond_module_info.hpp" #include "axond_auth.hpp" #include "basic_exception.hpp" #include <dlfcn.h> CapidModuleRest::CapidModuleRest(std::map<Method, CapidModuleSharedAccess>& permission, CapidModuleSharedBase::_rest_action_callback _getCallback, CapidModuleSharedBase::_rest_...
#include "coreir.h" #include "coreir/passes/analysis/firrtl.h" using namespace std; using namespace CoreIR; string toFConst(BitVector bv) { return "UInt<"+to_string(bv.bitLength())+">(" + to_string(bv.to_type<uint64_t>()) + ")"; } string toFConst(int i) { return "UInt(" + to_string(i) + ")"; } string CoreIR::Pas...
/****************************************************************************** Copyright (c) 2015 Teardrop Games 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 wit...
#include <cassert> #include <iostream> #include <string> #include <unordered_map> #include <array> #include <utility> #include <initializer_list> #include <SDL.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <tinyxml2.h> #include "gl_core_3_3.h" #include "util.h" #include "texture_atlas.h" TextureAtlas::Text...
#include <iostream> #include <fstream> #include <vector> using namespace std; //========================== use this to control output #define SITUATION_22 #define SINK_STATION_EXIST //====================================================== #ifdef SITUATION_22 #define FILE_NAME "matrix22.txt" #define STATION_NUM 22 #e...
/* * <EMAIL> * * Simple passthrough daemon reference. */ #include <dirent.h> #include <iterator> #include <cstdlib> #include <cstring> #include <sstream> #include <iostream> #include <stdlib.h> #include <string> #include <sys/stat.h> #include <syslog.h> #include <unistd.h> #include <vector> #include <stdbool.h> #in...
// main.cpp #include <iostream> #include <opencv2/opencv.hpp> #include <opencv2/highgui.hpp> using std::cout; using std::endl; cv::Mat img; cv::Mat img_gray; cv::Mat blurred; cv::Mat edged; void locator(int event, int x, int y, int flags, void *userdata) { //function to track mouse movement and click// if (even...
#include <QVBoxLayout> #include <QLineEdit> #include "display.h" void ArgString_Separ( std::string& arg, size_t count, char separ) { int64_t insertPosition = arg.length() - count; int64_t minpos = 0; if ( arg.length() > 0 ) if ( arg.front() == '-' || arg.back() == '+' ) minpo...
#include "avl.h" No::No() { valor = 0; esquerda = NULL; direita = NULL; altura = 1; } No::No(int n) { valor = n; esquerda = NULL; direita = NULL; altura = 1; } int altura(No *N) { if (N == NULL) return 0; return N->altura; } int max(int valorA, int valorB) { return (valorA > valorB) ? valorA...
#include "SandboxLayer.h" #include "stb_image/stb_image.h" using namespace GLCore; using namespace GLCore::Utils; SandboxLayer::SandboxLayer() { } SandboxLayer::~SandboxLayer() { } void SandboxLayer::OnAttach() { EnableGLDebugging(); // Init here m_Shader.push_back(Shader::FromGLSLTextFiles( "assets/shaders/4...
/* * Copyright (c) 2016-2019, NVIDIA CORPORATION. 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 * * Unles...
/* * Copyright 2007-2021 CM4all GmbH * All rights reserved. * * author: <NAME> <<EMAIL>> * * 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 ...
#include <iostream> #include <cstring> /* Cabeçalho com definições gerais para o autômato, compartilhadas * entre demais partes do programa. */ #include "macros.hpp" /* Cabeçalho com definições relacionadas à interface gráfica. * Estas definições foram separadas para garantir a legibilidade * deste arquivo. */ #in...
// Copyright (c) 2022 John "ComputerCraftr" Studnicka #include <tsp.h> #include <solvers.h> #include <cstdint> #include <algorithm> #include <iostream> #include <vector> int main(int argc, char *argv[]) { // Initialize RNG const int64_t nTime = time(nullptr); srand(nTime); //srand(1642255937); pr...
/* * * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. * * 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 opti...
//main.cpp // Copyright Querysoft Limited 2013 // // Permission is hereby granted, free of charge, to any person or organization // obtaining a copy of the software and accompanying documentation covered by // this license (the "Software") to use, reproduce, display, distribute, // execute, and transmit the Software, ...
/* * Copyright 2019 Xilinx 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 ...
#include "SimulationCore_pcp.h" #include "Model_R2D_ME_MPM.h" Model_R2D_ME_MPM::Model_R2D_ME_MPM() : object_num(0) {} Model_R2D_ME_MPM::~Model_R2D_ME_MPM() {} void Model_R2D_ME_MPM::cal_shape_function(ParticleVar_R2D_ME *ppcl_var) { double xLower, xUpper, yLower, yUpper; double xMiddle, xHalfLength, yMiddle, yH...
/* MIT License Copyright (c) 2020 Piter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribu...
#include <cassert> #include <cmath> #include <iostream> #include "joml.hpp" using namespace std::literals; std::string getIndent(size_t depth) { std::string ret; for (size_t i = 0; i < depth; ++i) ret.append(" "); return ret; } std::optional<std::string> escape(std::string_view str) { std...
/****************************************************************************** Module: VMQuery.cpp Notices: Copyright (c) 2008 <NAME> & <NAME> ******************************************************************************/ #include "..\CommonFiles\CmnHdr.h" /* See Appendix A. */ #include <windowsx.h> #i...
#include "./shadows.hpp" #include <lava/magma/camera.hpp> #include <lava/magma/light.hpp> #include <lava/magma/scene.hpp> #include "../aft-vulkan/scene-aft.hpp" #include "./render-engine-impl.hpp" #include "./render-image-impl.hpp" using namespace lava::magma; Shadows::Shadows(Scene& scene) : m_scene(scene) ...
#include <iostream> #include "ISRouter.hpp" #include "ISTransporter.hpp" #include "Encryption/ISEncryptor.hpp" extern "C" { #include <unistd.h> #include <sys/select.h> #include <sys/uio.h> #include <pthread.h> #include <signal.h> #include <arpa/inet.h> #include <sys/socket.h> #include "ist_protocol.h" } const int MA...
/* * Copyright (c) 2017-2018, NVIDIA CORPORATION. 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 ...
/*--------------------------------------------------------------- Programmer(s): <NAME> @ SMU ---------------------------------------------------------------- Copyright (c) 2019, Southern Methodist University. All rights reserved. For details, see the LICENSE file. ------------------------------------------------...
#include "CarrierManager.h" #include "Util.h" #include "CCBot.h" CarrierInfo::CarrierInfo() : m_hpLastSecond(45) { } CarrierInfo::CarrierInfo(float hp) : m_hpLastSecond(hp) { } CarrierManager::CarrierManager(CCBot & bot) : MicroManager(bot) { } void CarrierManager::executeMicro(const std::vector<const sc2::Un...
#include "gtest/gtest.h" #include "AprioriFilter.h" #include "TestDataSets.h" #include <iostream> #include <string> using namespace std; // aExpected is itemsets, space delimted, and item inside the set ',' delimited. bool CheckSet(string aExpected, set<ItemSet> aObserved) { vector<string> itemsets; Tokenize(aEx...
/* * Copyright (c) 2011-2014, Intel 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: * * 1. Redistributions of source code must retain the above copyright notice, this * list of...
/* * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) * * This file is part of Orfeo Toolbox * * https://www.orfeo-toolbox.org/ * * 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 ...
#include <exception> #include "grayscale_bitmap.h" static const uint32_t FIXED_POINT_26_6_COEFF = 1<<6; GrayscaleBitmap::GrayscaleBitmap(const FT_Face fontFace) : rows(fontFace->size->metrics.height / FIXED_POINT_26_6_COEFF) , columns(fontFace->size->metrics.max_advance / FIXED_POINT_26_6_COEFF) , pixels(n...
#include <path_follower/supervisor/obstacletracker.h> #include <algorithm> using namespace std; namespace { //! Module name, that is used for ros console output const std::string MODULE = "s_obstacle_tracker"; } void ObstacleTracker::update(std::vector<Obstacle> observed_obstacles) { /** * There is a sligh...
/* * File : RS232_WriteString.c */ #define S_FUNCTION_NAME RS232_WriteString #define S_FUNCTION_LEVEL 2 #include <stdio.h> #include "simstruc.h" #include "RS232.h" // INPUT ARGUMENTS #define NUMBER_OF_ARGS 1 #define WRITESTRING ssGetSFcnParam(S,0) #define NO_I_WORKS 1 #define NO_P_WORKS 1 // LOCAL VARIAB...
// C++ code for Binary Search Tree using Array #include <iostream> using namespace std; int bst[10000]; // Empty Array for tree int i=1; //To store index to which data is last inserted // inorder traversal int inorder(int result[], int i, int in_size){ // step 1 - Traverse left subtree if(bst[2*i] != -1) ...
#include "wadlib.h" #include "zlib.h" #include "zstd.h" #include <filesystem> namespace fs = std::filesystem; static inline bool unhash(HashMap const& hashmap, uint64_t hash, std::string& result) { if(auto h = hashmap.find(hash); h != hashmap.end()) { result = h->second.name; return false; } e...
#undef STRINGIFY_EX #define STRINGIFY_EX(...) #__VA_ARGS__ #undef STRINGIFY #define STRINGIFY(...) STRINGIFY_EX(__VA_ARGS__) #undef TOKEN_CONCAT_EX #define TOKEN_CONCAT_EX(x, y) x##y #undef TOKEN_CONCAT #define TOKEN_CONCAT(x, y) TOKEN_CONCAT_EX(x, y) #undef LINE_TRACE_STR #define LINE_TRACE_STR __FILE__ ":" STRINGIF...
/******* * * Code : Stack Using LL Send Feedback Implement a Stack Data Structure specifically to store integer data using a Singly Linked List. The data members should be private. You need to implement the following public functions : 1. Constructor: It initialises the data members as required. 2. push(dat...